doc: mention timestamp portability issues
authorEric Blake <ebb9@byu.net>
Wed, 7 Oct 2009 17:58:54 +0000 (11:58 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 10 Oct 2009 14:25:15 +0000 (08:25 -0600)
* doc/glibc-functions/lutimes.texi (lutimes): Refer to utimensat
instead.
* doc/posix-functions/utime.texi (utime): Likewise.
* doc/posix-functions/utimes.texi (utimes): Likewise.
* doc/glibc-functions/futimes.texi (futimes): Refer to futimens
instead.
* doc/posix-functions/futimens.texi (futimens): Mention utimens
module.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.
Mention weakness with symlink timestamps.
* doc/glibc-functions/futimesat.texi (futimesat): New file; refer
to utimensat/futimens instead.
* doc/gnulib.texi (Glibc sys/time.h): Include new file.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/glibc-functions/futimes.texi
doc/glibc-functions/futimesat.texi [new file with mode: 0644]
doc/glibc-functions/lutimes.texi
doc/gnulib.texi
doc/posix-functions/futimens.texi
doc/posix-functions/utime.texi
doc/posix-functions/utimensat.texi
doc/posix-functions/utimes.texi

index f2427e46679f504d5776f47477641c09318bd2fc..8a34a5be993f9c5bba90957de04bc2b501e80d00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2009-10-10  Eric Blake  <ebb9@byu.net>
 
+       doc: mention timestamp portability issues
+       * doc/glibc-functions/lutimes.texi (lutimes): Refer to utimensat
+       instead.
+       * doc/posix-functions/utime.texi (utime): Likewise.
+       * doc/posix-functions/utimes.texi (utimes): Likewise.
+       * doc/glibc-functions/futimes.texi (futimes): Refer to futimens
+       instead.
+       * doc/posix-functions/futimens.texi (futimens): Mention utimens
+       module.
+       * doc/posix-functions/utimensat.texi (utimensat): Likewise.
+       Mention weakness with symlink timestamps.
+       * doc/glibc-functions/futimesat.texi (futimesat): New file; refer
+       to utimensat/futimens instead.
+       * doc/gnulib.texi (Glibc sys/time.h): Include new file.
+
        test-dup2: enhance test
        * tests/test-dup2.c (main): Also check AT_FDCWD.
 
index e53b6ed15c1e2ae58e927b97564668ce22269645..0df4706b937d056052f7ade17a9ff6c5b8c1fa7b 100644 (file)
@@ -12,5 +12,9 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5, BeOS.
+AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix
+3.5, BeOS.
+@item
+This function cannot set full timestamp resolution.  Use
+@code{futimens(fd,times)} instead.
 @end itemize
diff --git a/doc/glibc-functions/futimesat.texi b/doc/glibc-functions/futimesat.texi
new file mode 100644 (file)
index 0000000..dbd3d1d
--- /dev/null
@@ -0,0 +1,21 @@
+@node futimesat
+@subsection @code{futimesat}
+@findex futimesat
+
+Gnulib module: ---
+
+Portability problems fixed by Gnulib:
+@itemize
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+This function is missing on some platforms:
+glibc 2.3.6, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX
+5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw,
+Interix 3.5, BeOS.
+@item
+This function cannot set full timestamp resolution.  Use
+@code{file ? utimensat(fd,file,times,0) : futimens(fd,times)} instead.
+@end itemize
index 96308e0c12ac1c914ec9a4cdefe7d3fbf6f553dc..2971c99ece9716ea17a3aeb1eba4f5515cb4b68d 100644 (file)
@@ -12,5 +12,14 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-MacOS X 10.3, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5, BeOS.
+MacOS X 10.3, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1,
+Solaris 10, mingw, Interix 3.5, BeOS.
+@item
+This function cannot set full timestamp resolution.  Use
+@code{utimensat(AT_FDCWD,file,times,AT_SYMLINK_NOFOLLOW)} instead.
+@item
+The mere act of using @code{lstat} modifies the access time of
+symlinks on some platforms, so @code{lutimes} can only effectively
+change modification time:
+Cygwin.
 @end itemize
index b3085d4ada2e3164383094cb7376e6551094985b..8566eb3333af1b647c385fc775a443e874767c01 100644 (file)
@@ -5482,12 +5482,14 @@ This list of functions is sorted according to the header that declares them.
 @menu
 * adjtime::
 * futimes::
+* futimesat::
 * lutimes::
 * settimeofday::
 @end menu
 
 @include glibc-functions/adjtime.texi
 @include glibc-functions/futimes.texi
+@include glibc-functions/futimesat.texi
 @include glibc-functions/lutimes.texi
 @include glibc-functions/settimeofday.texi
 
index 0fb5935106aa04044e91d90d2dd1ed9704d06ced..2a1a77918f71f5a4b1a98d7c2ab32bda40003596 100644 (file)
@@ -15,5 +15,20 @@ Portability problems not fixed by Gnulib:
 @item
 This function is missing on some platforms:
 glibc 2.3.6, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX
-5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
+5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw,
+Interix 3.5, BeOS.
+@item
+This function returns a bogus value instead of failing with
+@code{ENOSYS} on some platforms:
+Linux kernel 2.6.21.
+@item
+When using @code{UTIME_OMIT} or @code{UTIME_NOW}, some systems require
+the @code{tv_sec} argument to be 0, and don't necessarily handle all
+file permissions in the manner required by POSIX:
+Linux kernel 2.6.25.
+@item
+Some platforms lack the ability to change the timestamps of a file
+descriptor, so this function can fail with @code{ENOSYS}.
 @end itemize
+
+The gnulib module utimens provides a similar interface.
index 9b5a7eeaf61423b3fa681ca06b2b57af83e0ad82..d14685c1bc28c9d77cf7c87325930068d48634a9 100644 (file)
@@ -15,4 +15,12 @@ file's timestamp to the current time.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function cannot set full timestamp resolution.  Use
+@code{utimensat(AT_FDCWD,file,times,0)} instead.
+@item
+On some platforms, the prototype for @code{utime} omits @code{const}
+for the second argument.  Fortunately, the argument is not modified,
+so it is safe to cast away const:
+mingw.
 @end itemize
index 23a5582ad76620813759d429fd680acc10096bb8..1dcfe8c111bc9dd40523a3abeae8f66d77c7dc1c 100644 (file)
@@ -15,5 +15,26 @@ Portability problems not fixed by Gnulib:
 @item
 This function is missing on some platforms:
 glibc 2.3.6, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX
-5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
+5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw,
+Interix 3.5, BeOS.
+@item
+This function returns a bogus value instead of failing with
+@code{ENOSYS} on some platforms:
+Linux kernel 2.6.21.
+@item
+When using @code{UTIME_OMIT} or @code{UTIME_NOW}, some systems require
+the @code{tv_sec} argument to be 0, and don't necessarily handle all
+file permissions in the manner required by POSIX:
+Linux kernel 2.6.25.
+@item
+On some platforms, timestamps of symbolic links cannot be modified, so
+this function fails with @code{ENOSYS} if passed the flag
+@code{AT_SYMLINK_NOFOLLOW}.
+@item
+The mere act of using @code{lstat} modifies the access time of
+symlinks on some platforms, so @code{utimensat} with
+@code{AT_SYMLINK_NOFOLLOW} can only effectively change modification time:
+Cygwin.
 @end itemize
+
+The gnulib module utimens provides a similar interface.
index 8ab90d91d34856fbe32c4a7dc7a191172ed78717..5f6cb7b74b7b7f9ba404f8c63806c5731b9d2782 100644 (file)
@@ -16,6 +16,15 @@ Portability problems not fixed by Gnulib:
 This function is missing on some platforms:
 mingw, Interix 3.5, BeOS.
 @item
-This function is marked as ``legacy'' in POSIX.  Better use @code{utime}
-instead.
+This function cannot set full timestamp resolution.  In particular,
+some platforms incorrectly round rather than truncate.  Use
+@code{utimensat(AT_FDCWD,file,times,0)} instead.
+@item
+On some platforms, @code{utimes (file, NULL)} fails to set the
+file's timestamp to the current time:
+glibc 2.3.3.
+@item
+On some platforms, @code{utimes} failed on read-only files when
+@code{utime} worked fine.
+glibc 2.2.5.
 @end itemize