stat: work around Solaris bug with tv_nsec < 0
commit2c5d5587453d18cf83bdf67b4914db5e5db684b1
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 23 Nov 2017 08:05:57 +0000 (23 00:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 23 Nov 2017 08:06:42 +0000 (23 00:06 -0800)
treeb2b1f2682c97bc7a9087651aee6f3a9db05fe9e9
parent6245cd45374f0db1e832ed81b1b7c60ef8f5784f
stat: work around Solaris bug with tv_nsec < 0

* doc/posix-functions/fstat.texi (fstat):
* doc/posix-functions/fstatat.texi (fstatat):
* doc/posix-functions/lstat.texi (lstat):
* doc/posix-functions/stat.texi (stat):
Mention Solaris 11 bug.
* lib/fstat.c, lib/fstatat.c, lib/lstat.c: Include stat-time.h.
* lib/fstat.c (rpl_fstat) [!WINDOWS_NATIVE]:
* lib/lstat.c (rpl_lstat):
* lib/stat.c (rpl_stat):
Normalize resulting timestamps.
* lib/fstatat.c (normal_fstatat): New function.
(rpl_fstatat): Use it.
* lib/stat-time.h: Include intprops.h, errno.h, stddef.h.
(stat_time_normalize): New function.
* m4/fstat.m4 (gl_FUNC_FSTAT):
* m4/fstatat.m4 (gl_FUNC_FSTATAT):
* m4/lstat.m4 (gl_FUNC_LSTAT):
* m4/stat.m4 (gl_FUNC_STAT):
Replace on Solaris.
* modules/fstat (Depends-on):
* modules/fstatat (Depends-on):
Add stat-time.
* modules/stat-time (Depends-on): Add errno, intprops.
17 files changed:
ChangeLog
doc/posix-functions/fstat.texi
doc/posix-functions/fstatat.texi
doc/posix-functions/lstat.texi
doc/posix-functions/stat.texi
lib/fstat.c
lib/fstatat.c
lib/lstat.c
lib/stat-time.h
lib/stat.c
m4/fstat.m4
m4/fstatat.m4
m4/lstat.m4
m4/stat.m4
modules/fstat
modules/fstatat
modules/stat-time