sys/stat.h
==========

POSIX specification:
 https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Gnulib module: sys_stat

Portability problems fixed by Gnulib module sys_stat:

  * The type mode_t is not defined on some platforms: MSVC 14.

  * Some macros, such as S_IFMT or S_IFIFO, are missing on some platforms.

  * The macros S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISLNK, S_ISREG, S_ISSOCK are broken on some platforms.

  * Some platforms define macros, such as S_ISDOOR, that are not defined on other platforms.

  * The functions lstat and mkdir are not declared on some platforms: mingw, MSVC 14.

  * The macros UTIME_NOW and UTIME_OMIT are missing on some platforms.

  * On some platforms, struct stat does not include st_atim, st_mtim, or st_ctim members.  Use the gnulib module stat-time for accessors to portably get at subsecond resolution.

Portability problems fixed by Gnulib module sys_stat, together with module windows-stat-inodes:

  * On Windows platforms (excluding Cygwin), st_ino is always 0.

Portability problems not fixed by Gnulib:

  * See time.h, for general portability problems with the time_t components of struct stat.

  * The macro S_IFBLK is missing on some platforms: MSVC 14.

  * On OpenVMS, st_ino is an array of three ino_t values, not a single value.

  * To partially work around the previous two problems, you can test for nonzero st_ino and use the Gnulib same-inode module to compare nonzero values.  For example, SAME_INODE (a, b) is true if the struct stat values a and b are known to represent the same file, (a.st_ino && !SAME_INODE (a, b)) is true if they are known to represent different files, and !a.st_ino is true if it is not known whether they represent different files.

  * On some platforms, two different files may have the same st_dev and st_ino values, even when st_ino is nonzero:

       * GNU/Linux NFS servers that export all local file systems as a single NFS file system, if a local st_dev exceeds 255, or if a local st_ino exceeds 16777215.

       * Network Appliance NFS servers in snapshot directories; see Network Appliance bug #195.

       * ClearCase MVFS; see bug id ATRia04618.

     One partial workaround is to compare other file metadata such as st_mode and st_mtime to detect this bug, but this approach does not work on files whose metadata are being changed by other programs.

  * On some file systems, st_size contains bogus information for symlinks; use the Gnulib module areadlink-with-size for a better way to get symlink contents.