diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-29 22:32:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-29 22:32:14 -0700 |
commit | 5f5d7f2e69b9f80dcbbe3f6e0626e4664db70364 (patch) | |
tree | 11ac8b173852faa53fc0e3bbf2194ba058f0b0cc /sysif.h | |
parent | 6896d02e5bdb2deb0f0b3d3becfe55dd9981a78b (diff) | |
download | txr-5f5d7f2e69b9f80dcbbe3f6e0626e4664db70364.tar.gz txr-5f5d7f2e69b9f80dcbbe3f6e0626e4664db70364.tar.bz2 txr-5f5d7f2e69b9f80dcbbe3f6e0626e4664db70364.zip |
stat: support high resolution time stamps.
* configure (have_sys_stat): New variable. Set to y when our
test detects <sys/stat.h>. New test added for the presence of
high resolution time stamps in struct stat. If we have these,
we #define HAVE_STAT_NSEC 1 in config.h.
* share/txr/stdlib/path-test.tl (path-newer): Compare
nanosecond parts of the modification time if the seconds are
equal, improving the resolution of the test.
* sysif.c (atime_nsec_s, mtime_nsec_s, ctime_nsec_s): New
symbol variables.
(stat_to_struct): If nanosecond resolution is available, set
the new nanosecond slots from the three tv_nsec fields in
struct stat. Otherwise, set the new slots to zero.
(sysif_init): Initialize the new symbol variables. Add the
three new slots to the stat struct.
* sysif.c (atime_nsec_s, mtime_nsec_s, ctime_nsec_s):
Declared.
* txr.1: Documented new atime-nsec, mtime-nsec and ctime-nsec
slots of stat structure. Added note to path-newer mentioning
high resolution support.
Diffstat (limited to 'sysif.h')
-rw-r--r-- | sysif.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -31,7 +31,9 @@ extern val gid_k, rdev_k, size_k, blksize_k, blocks_k; extern val atime_k, mtime_k, ctime_k; extern val dev_s, ino_s, mode_s, nlink_s, uid_s; extern val gid_s, rdev_s, size_s, blksize_s, blocks_s; -extern val atime_s, mtime_s, ctime_s, path_s; +extern val atime_s, mtime_s, ctime_s; +extern val atime_nsec_s, mtime_nsec_s, ctime_nsec_s; +extern val path_s; #if !HAVE_FTRUNCATE typedef long off_t; |