diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-11-26 06:30:35 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-11-26 06:30:35 +0000 |
commit | c63680e87b2052cb573bff107b87f43bf679c011 (patch) | |
tree | ccdfaf3b897f7f387d617d8364bdd26f4c1e4d76 /lib | |
parent | 1b7e4389dc0aa0cf7c9743e87b7d6f42a5bdc7f2 (diff) | |
download | coreutils-c63680e87b2052cb573bff107b87f43bf679c011.tar.xz |
(gettime) [!defined OK_TO_USE_1S_CLOCK]:
Report an error at compile-time if only a 1-second nominal clock
resolution is found.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gettime.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gettime.c b/lib/gettime.c index 0f94297da..d60711b53 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -45,8 +45,14 @@ gettime (struct timespec *ts) ts->tv_nsec = tv.tv_usec * 1000; } # else + +# ifndef OK_TO_USE_1S_CLOCK +# error "Only 1-second nominal clock resolution found. Is that intended?" \ + "If so, compile with the -DOK_TO_USE_1S_CLOCK option." +# endif ts->tv_sec = time (NULL); ts->tv_nsec = 0; + # endif #endif |