diff --git a/ChangeLog b/ChangeLog
index fe5a25c6cffb2e67884b8707daf81bf36eb6a076..68c47655cd445d49c43c076960389439ecb8687a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-27	Jannis Pohlmann <jannis@xfce.org>
+
+	* configure.in.in, thunar-vfs/thunar-vfs-monitor.c: Add HAVE_LINUX
+	  define to config.h and implement support for excluding certain base
+	  paths (such as /dev and /proc) from being being monitored. Gamin
+	  does the same but only for dnotify and inotify, not for polling.
+
 2008-11-26	Nick Schermer <nick@xfce.org>
 
 	* thunar/thunar-application.c: Create a new window group for
diff --git a/configure.in.in b/configure.in.in
index c1b8c1a274a816eafb6aefdf99586c857f28b160..279d56228ed45795684abd4ae65f50503cd7bb23 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -49,6 +49,10 @@ AC_AIX()
 AC_ISC_POSIX()
 AC_MINIX()
 
+if test "x$target_os" = "xlinux-gnu"; then
+  AC_DEFINE([HAVE_LINUX], [], [Whether we are building on Linux or not])
+fi
+
 dnl ********************************
 dnl *** Check for basic programs ***
 dnl ********************************
diff --git a/thunar-vfs/thunar-vfs-monitor.c b/thunar-vfs/thunar-vfs-monitor.c
index 5acc90dac7b4c76b3cd30e632099a6ea0de83c01..3a00c9857f127bf3590c3e0d11eae0bf3d7313ac 100644
--- a/thunar-vfs/thunar-vfs-monitor.c
+++ b/thunar-vfs/thunar-vfs-monitor.c
@@ -73,6 +73,8 @@ static gboolean thunar_vfs_monitor_fam_watch            (GIOChannel            *
                                                          GIOCondition           condition,
                                                          gpointer               user_data);
 #endif
+static gboolean thunar_vfs_monitor_is_excluded_path     (ThunarVfsMonitor      *monitor,
+                                                         ThunarVfsPath         *path);
 
 
 
@@ -102,6 +104,9 @@ struct _ThunarVfsMonitor
   FAMConnection                 fc;
   gint                          fc_watch_id;
 #endif
+
+  /* Excluded paths */
+  GList                        *excluded_paths;
 };
 
 struct _ThunarVfsMonitorHandle
@@ -134,6 +139,15 @@ struct _ThunarVfsMonitorNotification
 
 static GObjectClass *thunar_vfs_monitor_parent_class;
 
+static const gchar *excluded_paths[] = 
+{
+#ifdef HAVE_LINUX
+  "/proc/*",
+  "/dev/*",
+#endif
+  NULL
+};
+
 
 
 GType
@@ -174,10 +188,17 @@ thunar_vfs_monitor_class_init (ThunarVfsMonitorClass *klass)
 static void
 thunar_vfs_monitor_init (ThunarVfsMonitor *monitor)
 {
+  gint i;
+
   /* initialize the monitor */
   monitor->cond = g_cond_new ();
   monitor->lock = g_mutex_new ();
 
+  /* Generate pattern specs for excluded paths */
+  monitor->excluded_paths = NULL;
+  for (i = 0; excluded_paths[i] != NULL; ++i)
+    monitor->excluded_paths = g_list_append (monitor->excluded_paths, g_pattern_spec_new (excluded_paths[i]));
+
 #ifdef HAVE_LIBFAM
   if (FAMOpen2 (&monitor->fc, PACKAGE_NAME) == 0)
     {
@@ -214,6 +235,9 @@ thunar_vfs_monitor_finalize (GObject *object)
     thunar_vfs_monitor_fam_cancel (monitor);
 #endif
 
+  /* drop excluded path patterns */
+  g_list_foreach (monitor->excluded_paths, (GFunc) g_pattern_spec_free, NULL);
+
   /* drop the notifications timer source */
   if (G_UNLIKELY (monitor->notifications_timer_id != 0))
     g_source_remove (monitor->notifications_timer_id);
@@ -491,6 +515,53 @@ thunar_vfs_monitor_fam_watch (GIOChannel  *channel,
 
 
 
+/**
+ * thunar_vfs_monitor_is_excluded_path:
+ * @monitor : a #ThunarVfsMonitor.
+ * @path    : a #ThunarVfsPath
+ *
+ * Checks whether the path is among the paths to be excluded from 
+ * monitoring.
+ *
+ * Return value: %TRUE if @path should be excluded from monitoring, 
+ *               %FALSE otherwise.
+ **/
+static gboolean
+thunar_vfs_monitor_is_excluded_path (ThunarVfsMonitor *monitor,
+                                     ThunarVfsPath    *path)
+{
+  GList   *iter;
+  gboolean excluded = FALSE;
+  gchar   *path_string;
+  gint     length;
+
+  _thunar_vfs_return_val_if_fail (THUNAR_VFS_IS_MONITOR (monitor), TRUE);
+  _thunar_vfs_return_val_if_fail (path != NULL, TRUE);
+
+  /* Turn path into a string */
+  path_string = thunar_vfs_path_dup_string (path);
+
+  if (G_LIKELY (path_string != NULL))
+    {
+      length = strlen (path_string);
+
+      /* Match path against all exclude patterns. Return TRUE if it matches at 
+       * least one of these patterns */
+      for (iter = g_list_first (monitor->excluded_paths); iter != NULL; iter = g_list_next (iter))
+        if (g_pattern_match (iter->data, length, path_string, NULL))
+          {
+            excluded = TRUE;
+            break;
+          }
+
+      g_free (path_string);
+    }
+
+  return excluded;
+}
+
+
+
 /**
  * thunar_vfs_monitor_get_default:
  *
@@ -540,6 +611,9 @@ thunar_vfs_monitor_add_directory (ThunarVfsMonitor        *monitor,
   g_return_val_if_fail (callback != NULL, NULL);
   g_return_val_if_fail (path != NULL, NULL);
 
+  if (G_UNLIKELY (_thunar_vfs_path_is_local (path) && thunar_vfs_monitor_is_excluded_path (monitor, path)))
+    return NULL;
+
   /* acquire the monitor lock */
   g_mutex_lock (monitor->lock);
 
@@ -604,6 +678,9 @@ thunar_vfs_monitor_add_file (ThunarVfsMonitor        *monitor,
   g_return_val_if_fail (callback != NULL, NULL);
   g_return_val_if_fail (path != NULL, NULL);
 
+  if (G_UNLIKELY (_thunar_vfs_path_is_local (path) && thunar_vfs_monitor_is_excluded_path (monitor, path)))
+    return NULL;
+
   /* acquire the monitor lock */
   g_mutex_lock (monitor->lock);