]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP, MTIME_CMP): New macros.
authorJim Meyering <jim@meyering.net>
Sun, 2 Aug 1998 16:24:13 +0000 (16:24 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 2 Aug 1998 16:24:13 +0000 (16:24 +0000)
src/system.h

index 84ac9cd684d402e0a36b64e6f9039866184ae5a1..73739e56a9fe0da8c991eb7510cf4e718a822423 100644 (file)
 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
 #endif
 
+#ifdef HAVE_ST_MTIM
+# define ST_TIME_CMP_NS(a, b, ns) ((a).ns < (b).ns ? -1 : (a).ns > (b).ns)
+#else
+# define ST_TIME_CMP_NS(a, b, ns) 0
+#endif
+#define ST_TIME_CMP(a, b, s, ns) \
+  ((a).s < (b).s ? -1 : (a).s > (b).s ? 1 : ST_TIME_CMP_NS(a, b, ns))
+#define ATIME_CMP(a, b) ST_TIME_CMP (a, b, st_atime, st_atim.tv_nsec)
+#define CTIME_CMP(a, b) ST_TIME_CMP (a, b, st_ctime, st_ctim.tv_nsec)
+#define MTIME_CMP(a, b) ST_TIME_CMP (a, b, st_mtime, st_mtim.tv_nsec)
+
 #if !defined(HAVE_MKFIFO)
 # define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
 #endif