From b4048073e620a8d84baebf299819a4f409cbbfea Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 24 Oct 2016 12:15:56 +0000 Subject: More strict test for SKALIBS_HASTIMER (must have struct itimerspec and struct sigevent too) --- src/sysdeps/trytimer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sysdeps/trytimer.c b/src/sysdeps/trytimer.c index 84cea0d..9d6291b 100644 --- a/src/sysdeps/trytimer.c +++ b/src/sysdeps/trytimer.c @@ -1,12 +1,14 @@ /* ISC license. */ -#include #include #include int main (void) { timer_t blah ; - if (timer_create(CLOCK_REALTIME, 0, &blah) < 0) return 111 ; + struct itimerspec it = { .it_interval = { .tv_sec = 0, .tv_nsec = 0 }, .it_value = { .tv_sec = 1, .tv_nsec = 0 } } ; + struct sigevent se = { .sigev_notify = SIGEV_SIGNAL, .sigev_signo = SIGALRM, .sigev_value = { .sival_int = 0 }, .sigev_notify_function = 0, .sigev_notify_attributes = 0 } ; + if (timer_create(CLOCK_REALTIME, &se, &blah) < 0) return 111 ; + if (timer_settime(blah, TIMER_ABSTIME, &it, 0) < 0) return 111 ; return 0 ; } -- cgit v1.2.3