diff options
author | Stafford Horne <shorne@gmail.com> | 2021-08-19 23:47:07 +0900 |
---|---|---|
committer | Stafford Horne <shorne@gmail.com> | 2021-09-16 05:21:08 +0900 |
commit | 5604830dea207bbd5fd5dbe087cc7ca30b527bb5 (patch) | |
tree | 23498103fc324178527490e783ff667c40302ee4 /support | |
parent | 2444ce5421c6036a503842d8dd8d93c27aad59ee (diff) | |
download | glibc-5604830dea207bbd5fd5dbe087cc7ca30b527bb5.zip glibc-5604830dea207bbd5fd5dbe087cc7ca30b527bb5.tar.gz glibc-5604830dea207bbd5fd5dbe087cc7ca30b527bb5.tar.bz2 |
time: Fix compile error in itimer test affecting hurd
The recent change to use __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 to avoid
doing 64-bit checks on some platforms broke the test for hurd where
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 is not defined. With error:
tst-itimer.c: In function 'do_test':
tst-itimer.c:103:11: error: '__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64' undeclared (first use in this function)
103 | if (__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tst-itimer.c:103:11: note: each undeclared identifier is reported only once for each function it appears in
Define a support helper to detect when setitimer and getitimer support
64-bit time_t.
Fixes commit 6e8a0aac2f ("time: Fix overflow itimer tests on 32-bit
systems").
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Joseph Myers <joseph@codesourcery.com>
Diffstat (limited to 'support')
-rw-r--r-- | support/support.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/support/support.h b/support/support.h index c219e0d..837a806 100644 --- a/support/support.h +++ b/support/support.h @@ -152,6 +152,18 @@ static __inline bool support_path_support_time64 (const char *path) 0x80000002ULL); } +/* Return true if the setitimer and getitimer syscalls support 64-bit time_t + values without resulting in overflow. This is not true on some linux systems + which have 64-bit time_t due to legacy kernel API's. */ +static __inline bool support_itimer_support_time64 (void) +{ +#ifdef __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 + return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; +#else + return sizeof (__time_t) == 8; +#endif +} + /* Return true if stat supports nanoseconds resolution. PATH is used for tests and its ctime may change. */ extern bool support_stat_nanoseconds (const char *path); |