bug-gnulib
[Top][All Lists]
Advanced

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

Re: same-inode.h and OpenVMS


From: Paul Eggert
Subject: Re: same-inode.h and OpenVMS
Date: Sat, 31 Dec 2011 13:41:26 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

OK, thanks, I installed the gnulib patch.  I also
installed the following gnulib documentation change to try
to get all this stuff written down better.

doc: cover st_ino issues once; add OpenVMS etc.
* doc/posix-functions/stat.texi (stat):
* doc/posix-functions/lstat.texi (lstat):
* doc/posix-functions/fstatat.texi (fstatat):
* doc/posix-functions/fstat.texi (fstat):
Move general 'struct stat' stuff to sys_stat.texi,
leaving behind a pointer.
* doc/posix-headers/sys_stat.texi (sys/stat.h):
Merge duplicate info about 'struct stat' problems into here.
Mention issues with OpenVMS, GNU/Linux NFS, NetApp, ClearCase,
and suggest partial workarounds.
diff --git a/doc/posix-functions/fstat.texi b/doc/posix-functions/fstat.texi
index 31b4365..0f5b860 100644
--- a/doc/posix-functions/fstat.texi
+++ b/doc/posix-functions/fstat.texi
@@ -20,6 +20,8 @@ report the size of files or block devices larger than 2 GB.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
address@hidden/stat.h}, for general portability problems with @code{struct 
stat}.
address@hidden
 On Cygwin, @code{fstat} applied to the file descriptors 0 and 1, returns
 different @code{st_ino} values, even if standard input and standard output
 are not redirected and refer to the same terminal.
diff --git a/doc/posix-functions/fstatat.texi b/doc/posix-functions/fstatat.texi
index fcb2b30..8b8604f 100644
--- a/doc/posix-functions/fstatat.texi
+++ b/doc/posix-functions/fstatat.texi
@@ -30,9 +30,5 @@ Solaris 9.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-On Windows platforms (excluding Cygwin), @code{st_ino} is always 0.
address@hidden
-On some file systems, @code{st_size} contains bogus information for
-symlinks; use the gnulib module areadlink-with-size for a better way
-to get symlink contents.
address@hidden/stat.h}, for general portability problems with @code{struct 
stat}.
 @end itemize
diff --git a/doc/posix-functions/lstat.texi b/doc/posix-functions/lstat.texi
index 8ffa66f..6f5cfc2 100644
--- a/doc/posix-functions/lstat.texi
+++ b/doc/posix-functions/lstat.texi
@@ -28,15 +28,5 @@ On Windows platforms (excluding Cygwin), symlinks are not 
supported, so
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-On Windows platforms (excluding Cygwin), @code{st_ino} is always 0.
address@hidden
-Because of the definition of @code{struct stat}, it is not possible to
-portably replace @code{stat} via an object-like macro.  Therefore,
-expressions such as @code{(islnk ? lstat : stat) (name, buf)} are not
-portable, and should instead be written @code{islnk ? lstat (name,
-buf) : stat (name, buf)}.
address@hidden
-On some file systems, @code{st_size} contains bogus information for
-symlinks; use the gnulib module areadlink-with-size for a better way
-to get symlink contents.
address@hidden/stat.h}, for general portability problems with @code{struct 
stat}.
 @end itemize
diff --git a/doc/posix-functions/stat.texi b/doc/posix-functions/stat.texi
index 09c3839..f92d3a6 100644
--- a/doc/posix-functions/stat.texi
+++ b/doc/posix-functions/stat.texi
@@ -25,11 +25,11 @@ mingw, MSVC 9.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
address@hidden/stat.h}, for general portability problems with @code{struct 
stat}.
address@hidden
 Cygwin's @code{stat} function sometimes sets @code{errno} to @code{EACCES} when
 @code{ENOENT} would be more appropriate.
 @item
-On Windows platforms (excluding Cygwin), @code{st_ino} is always 0.
address@hidden
 Because of the definition of @code{struct stat}, it is not possible to
 portably replace @code{stat} via an object-like macro.  Therefore,
 expressions such as @code{(islnk ? lstat : stat) (name, buf)} are not
diff --git a/doc/posix-headers/sys_stat.texi b/doc/posix-headers/sys_stat.texi
index 47b29f7..bd644f6 100644
--- a/doc/posix-headers/sys_stat.texi
+++ b/doc/posix-headers/sys_stat.texi
@@ -36,4 +36,40 @@ Portability problems not fixed by Gnulib:
 @item
 The macro @code{S_IFBLK} is missing on some platforms:
 MSVC 9.
address@hidden
+On Windows platforms (excluding Cygwin), @code{st_ino} is always 0.
address@hidden
+On OpenVMS, @code{st_ino} is an array of three @code{ino_t} values,
+not a single value.
address@hidden
+To partially work around the previous two problems, you can test for
+nonzero @code{st_ino} and use the Gnulib @code{same-inode} module to
+compare nonzero values.  For example, @code{(a.st_ino && SAME_INODE
+(a, b))} is true if the @code{struct stat} values @code{a} and
address@hidden are known to represent the same file, @code{(a.st_ino &&
+!SAME_INODE (a, b))} is true if they are known to represent different
+files, and @code{!a.st_ino} is true if it is not known whether they
+represent different files.
address@hidden
+On some platforms, two different files may have the same @code{st_dev}
+and @code{st_ino} values, even when @code{st_ino} is nonzero:
address@hidden
address@hidden
+GNU/Linux NFS servers that export all local file systems as a single
+NFS file system, if a local @code{st_dev} exceeds 255, or if a local
address@hidden exceeds 16777215.
address@hidden
+Network Appliance NFS servers in snapshot directories; see Network
+Appliance bug #195.
address@hidden
+ClearCase MVFS; see bug id ATRia04618.
address@hidden itemize
+One partial workaround is to compare other file metadata such as
address@hidden and @code{st_mtime} to detect this bug, but this
+approach does not work on files whose metadata are being changed by
+other programs.
address@hidden
+On some file systems, @code{st_size} contains bogus information for
+symlinks; use the Gnulib module @code{areadlink-with-size} for a
+better way to get symlink contents.
 @end itemize



reply via email to

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