mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP, MTIME_CMP): New macros.
This commit is contained in:
1 parent
9fc5987250
commit
0f7ac75854
1 file changed
+11
@@ -81,6 +81,17 @@
|
||||
# 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
|
||||
|
||||
Reference in new issue
Block a user