stat
====

POSIX specification:
 https://pubs.opengroup.org/onlinepubs/9699919799/functions/stat.html

Gnulib module: stat

Portability problems fixed by Gnulib:

  * On platforms where off_t is a 32-bit type, stat may not correctly report the size of files or block devices 2 GiB and larger. See Large File Support.

  * On Linux/x86 and Linux/x86_64, applications compiled in 32-bit mode cannot access files that happen to have a 64-bit inode number.  This can occur with file systems such as XFS (typically on large disks) and NFS. See Large File Support.

  * The st_atime, st_ctime, st_mtime fields are affected by the current time zone and by the DST flag of the current time zone on some platforms: mingw, MSVC 14 (when the environment variable TZ is set).

  * On MSVC 14, this function fails with error ENOENT on files such as C:\pagefile.sys and on directories such as C:\System Volume Information.

  * On some platforms, stat("link-to-file/",buf) succeeds instead of failing with ENOTDIR. macOS 11.1, FreeBSD 7.2, AIX 7.1, Solaris 9, mingw64.

  * On some platforms, stat(".",buf) and stat("./",buf) give different results: mingw, MSVC 14.

  * On macOS 12.6, when this function yields a timestamp with a nonpositive tv_sec value, tv_nsec might be in the range -999999999..-1, representing a negative nanoseconds offset from tv_sec.  Solaris 11.4 is similar, except that tv_sec might also be -1000000000.

Portability problems not fixed by Gnulib:

  * See sys/stat.h, for general portability problems with struct stat.

  * Cygwin's stat function sometimes sets errno to EACCES when ENOENT would be more appropriate.

  * Because of the definition of struct stat, it is not possible to portably replace stat via an object-like macro.  Therefore, expressions such as (islnk ? lstat : stat) (name, buf) are not portable, and should instead be written islnk ? lstat (name, buf) : stat (name, buf).