Gnulib module: stat
Portability problems fixed by Gnulib:
off_tis a 32-bit type,
statmay not correctly report the size of files or block devices larger than 2 GB. (Cf.
st_mtimefields 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
ENOENTon files such as ‘C:\pagefile.sys’ and on directories such as ‘C:\System Volume Information’.
stat("link-to-file/",buf)succeeds instead of failing with
ENOTDIR. macOS 11.1, FreeBSD 7.2, AIX 7.1, Solaris 9, mingw64.
stat("./",buf)give different results: mingw, MSVC 14.
tv_nsecmight be in the range -1000000000..-1, representing a negative nanoseconds offset from
Portability problems not fixed by Gnulib:
statfunction sometimes sets
ENOENTwould be more appropriate.
struct stat, it is not possible to portably replace
statvia 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).