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. FreeBSD 7.2, AIX 7.1, Solaris 9, mingw64.
stat("./",buf)give different results: mingw, MSVC 9.
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).