1 /* Test for crashing bugs when trying to create too many timers. */
7 #include <sys/resource.h>
14 thread (union sigval arg
)
24 struct itimerspec itval
;
25 struct sigevent sigev
;
27 itval
.it_interval
.tv_sec
= 2;
28 itval
.it_interval
.tv_nsec
= 0;
29 itval
.it_value
.tv_sec
= 2;
30 itval
.it_value
.tv_nsec
= 0;
32 sigev
.sigev_notify
= SIGEV_THREAD
;
33 sigev
.sigev_notify_function
= thread
;
34 sigev
.sigev_notify_attributes
= NULL
;
35 sigev
.sigev_value
.sival_ptr
= (void *) &timerId
;
37 for (i
= 0; i
< 100; i
++)
39 printf ("cnt = %d\n", i
);
41 if (timer_create (CLOCK_REALTIME
, &sigev
, &timerId
) < 0)
43 perror ("timer_create");
47 res
= timer_settime (timerId
, 0, &itval
, NULL
);
49 perror ("timer_settime");
51 res
= timer_delete (timerId
);
53 perror ("timer_delete");
59 # define TEST_FUNCTION do_test ()
61 # define TEST_FUNCTION 0
64 #include "../test-skeleton.c"