Index: gio/glocalfileinfo.c
===================================================================
--- gio/glocalfileinfo.c	(revision 7754)
+++ gio/glocalfileinfo.c	(working copy)
@@ -33,6 +33,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#define _GNU_SOURCE
 #include <fcntl.h>
 #include <errno.h>
 #ifdef HAVE_GRP_H
@@ -1191,6 +1192,23 @@
 
 #endif /* !G_OS_WIN32 */
 
+static int
+open_noatime (const char         *path,
+              GFileQueryInfoFlags flags)
+{
+  int fd;
+  
+#ifdef O_NOATIME
+  if (flags & G_FILE_QUERY_INFO_NOATIME)
+    fd = open (path, O_RDONLY | O_NOATIME);
+  if (fd < 0 && errno == EPERM)
+#endif
+    fd = open (path, O_RDONLY);
+
+  return fd;
+}
+
 static char *
 get_content_type (const char          *basename,
 		  const char          *path,
@@ -1235,7 +1253,7 @@
 	  if (sniff_length > 4096)
 	    sniff_length = 4096;
 	  
-	  fd = open (path, O_RDONLY);
+	  fd = open_noatime (path, flags);
 	  if (fd != -1)
 	    {
 	      ssize_t res;
Index: gio/gioenums.h
===================================================================
--- gio/gioenums.h	(revision 7754)
+++ gio/gioenums.h	(working copy)
@@ -142,12 +142,15 @@
  * GFileQueryInfoFlags:
  * @G_FILE_QUERY_INFO_NONE: No flags set.
  * @G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS: Don't follow symlinks.
+ * @G_FILE_QUERY_INFO_NOATIME: Try to avoid updating a file's 
+ *     access time when possible.
  *
  * Flags used when querying a #GFileInfo.
  */
 typedef enum {
   G_FILE_QUERY_INFO_NONE              = 0,
-  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1 << 0)   /*< nick=nofollow-symlinks >*/
+  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1 << 0), /*< nick=nofollow-symlinks >*/
+  G_FILE_QUERY_INFO_NOATIME           = (1 << 1)
 } GFileQueryInfoFlags;
 
 
