I've just discovered that the stat() call, and the corresponding struct stat, does not contain fields for the file times with precision greater than one second. For setting these times, there are a variety of {f,l}utime{n,}s() functions, but not for getting.
How then does obtain these times with nanosecond precision, preferably using POSIX API?
The
statstructure returned bystat()itself has been upgraded for POSIX.1-2008.The
struct statstructure contains the three modification times as:(from this OpenGroup link here under
Headers, <sys/stat.h>) and thatstruct timespecis defined there (in<time.h>) as containing at least:Previously, these three times were
time_tvalues with their one-second resolution.