42 |
}; |
}; |
43 |
# endif |
# endif |
44 |
|
|
45 |
# ifdef ST_MTIM_NSEC |
/* Return negative, zero, positive if A < B, A == B, A > B, respectively. |
46 |
# define ST_TIME_CMP_NS(a, b, ns) ((a).ns < (b).ns ? -1 : (a).ns > (b).ns) |
Assume the nanosecond components are in range, or close to it. */ |
47 |
# else |
static inline int |
48 |
# define ST_TIME_CMP_NS(a, b, ns) 0 |
timespec_cmp (struct timespec a, struct timespec b) |
49 |
# endif |
{ |
50 |
# define ST_TIME_CMP(a, b, s, ns) \ |
return (a.tv_sec < b.tv_sec ? -1 |
51 |
((a).s < (b).s ? -1 : (a).s > (b).s ? 1 : ST_TIME_CMP_NS(a, b, ns)) |
: a.tv_sec > b.tv_sec ? 1 |
52 |
# define ATIME_CMP(a, b) ST_TIME_CMP (a, b, st_atime, st_atim.ST_MTIM_NSEC) |
: a.tv_nsec - b.tv_nsec); |
53 |
# define CTIME_CMP(a, b) ST_TIME_CMP (a, b, st_ctime, st_ctim.ST_MTIM_NSEC) |
} |
|
# define MTIME_CMP(a, b) ST_TIME_CMP (a, b, st_mtime, st_mtim.ST_MTIM_NSEC) |
|
|
|
|
|
# ifdef ST_MTIM_NSEC |
|
|
# define TIMESPEC_NS(timespec) ((timespec).ST_MTIM_NSEC) |
|
|
# else |
|
|
# define TIMESPEC_NS(timespec) 0 |
|
|
# endif |
|
54 |
|
|
55 |
# if ! HAVE_DECL_NANOSLEEP |
# if ! HAVE_DECL_NANOSLEEP |
56 |
/* Don't specify a prototype here. Some systems (e.g., OSF) declare |
/* Don't specify a prototype here. Some systems (e.g., OSF) declare |