stat.2: Update information on nanosecond timestamp fields

Update feature test macro requirements for exposing these fields.
Note that these fields are specified in POSIX.1-2008.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2010-09-18 06:48:03 +02:00
parent 72dca4ff98
commit f593575224
1 changed files with 14 additions and 11 deletions

View File

@ -443,24 +443,27 @@ A sticky command appeared in Version 32V AT&T UNIX.
.SH NOTES
Since kernel 2.5.48, the
.I stat
structure supports nanosecond resolution for the three
file timestamp fields.
Glibc exposes the nanosecond component of each field using names either
of the form
.IR st_atim.tv_nsec ,
structure supports nanosecond resolution for the three file timestamp fields.
Glibc exposes the nanosecond component of each field using names of the form
.IR st_atim.tv_nsec
if the
.B _BSD_SOURCE
or
.B _SVID_SOURCE
feature test macro is defined,
or of the form
.IR st_atimensec ,
if neither of these macros is defined.
feature test macro is defined.
These fields are specified in POSIX.1-2008, and, starting with version 2.12,
glibc also exposes these field names if
.BR _POSIX_C_SOURCE
is defined with the value 200809L or greater, or
.BR _XOPEN_SOURCE
is defined with the value 700 or greater.
If none of the aforementioned macros are defined,
then the nanosecond values are exposed with names of the form
.IR st_atimensec .
On file systems that do not support subsecond timestamps,
these nanosecond fields are returned with the value 0.
the nanosecond fields are returned with the value 0.
.\" As at kernel 2.6.25, XFS and JFS support nanosecond timestamps,
.\" but ext2, ext3, and Reiserfs do not.
.\" FIXME . SUSv4 specifies nanosecond timestamps.
On Linux,
.BR lstat ()