bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

add dd support for O_NOATIME


From: Paul Eggert
Subject: add dd support for O_NOATIME
Date: Wed, 07 Dec 2005 13:15:33 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

dd, at least, should have support for Linux's new O_NOATIME flag.

(Perhaps cp as well? but that's another story.)

I installed this:

2005-12-07  Paul Eggert  <address@hidden>

        * NEWS: Mention dd's new noatime flag.
        * doc/coreutils.texi (dd invocation): New noatime flag.
        * src/system.h (O_NOATIME): Define to 0 if not already defined.
        * src/dd.c (flags, usage): Add support for noatime flag.

Index: NEWS
===================================================================
RCS file: /fetish/cu/NEWS,v
retrieving revision 1.349
diff -p -u -r1.349 NEWS
--- NEWS        26 Nov 2005 07:51:27 -0000      1.349
+++ NEWS        7 Dec 2005 21:01:35 -0000
@@ -42,6 +42,12 @@ GNU coreutils NEWS                      
   sha384sum: print or check a SHA384 (384-bit) checksum
   sha512sum: print or check a SHA512 (512-bit) checksum
 
+** New features
+
+  dd's new iflag=noatime option causes it to read a file without
+  updating its access time, on hosts that support this (currently only
+  Linux kernels, version 2.6.8 and later).
+
 ** Bug fixes
 
   rm (on systems with openat) can no longer exit before processing
Index: doc/coreutils.texi
===================================================================
RCS file: /fetish/cu/doc/coreutils.texi,v
retrieving revision 1.297
diff -p -u -r1.297 coreutils.texi
--- doc/coreutils.texi  26 Nov 2005 07:52:43 -0000      1.297
+++ doc/coreutils.texi  7 Dec 2005 21:01:40 -0000
@@ -6918,6 +6918,11 @@ Use synchronized I/O for both data and m
 @cindex nonblocking I/O
 Use non-blocking I/O.
 
address@hidden noatime
address@hidden noatime
address@hidden access time
+Do not update the file's access time.
+
 @item nofollow
 @opindex nofollow
 @cindex symbolic links, following
Index: src/system.h
===================================================================
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.137
diff -p -u -r1.137 system.h
--- src/system.h        28 Sep 2005 22:11:06 -0000      1.137
+++ src/system.h        7 Dec 2005 21:01:40 -0000
@@ -168,6 +168,10 @@ initialize_exit_failure (int status)
 # define O_NDELAY 0
 #endif
 
+#if !defined O_NOATIME
+# define O_NOATIME 0
+#endif
+
 #if !defined O_NONBLOCK
 # define O_NONBLOCK O_NDELAY
 #endif
Index: src/dd.c
===================================================================
RCS file: /fetish/cu/src/dd.c,v
retrieving revision 1.189
diff -p -u -r1.189 dd.c
--- src/dd.c    31 Oct 2005 08:39:14 -0000      1.189
+++ src/dd.c    7 Dec 2005 21:01:42 -0000
@@ -264,6 +264,7 @@ static struct symbol_value const flags[]
   {"binary",   O_BINARY},
   {"direct",   O_DIRECT},
   {"dsync",    O_DSYNC},
+  {"noatime",  O_NOATIME},
   {"noctty",   O_NOCTTY},
   {"nofollow", O_NOFOLLOW},
   {"nonblock", O_NONBLOCK},
@@ -465,6 +466,8 @@ Each FLAG symbol may be:\n\
        fputs (_("  sync      likewise, but also for metadata\n"), stdout);
       if (O_NONBLOCK)
        fputs (_("  nonblock  use non-blocking I/O\n"), stdout);
+      if (O_NOATIME)
+       fputs (_("  noatime   do not update access time\n"), stdout);
       if (O_NOFOLLOW)
        fputs (_("  nofollow  do not follow symlinks\n"), stdout);
       if (O_NOCTTY)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]