FreeBSD regtest: remove test for version 13+ syscalls
[valgrind.git] / memcheck / tests / freebsd / clock_nanosleep_interrupt.c
blob49f4a2814bf171bced3aa6835d6d64e07deb5739
1 #include <fcntl.h>
2 #include <signal.h>
3 #include <stdio.h>
4 #include <sys/time.h>
5 #include <unistd.h>
6 #include <stdlib.h>
8 volatile int ticks = 0;
9 struct itimerval timert;
10 struct sigaction timer_action;
12 void handle_vtalrm(int sig) { ticks++; }
15 int main(int argc, char* argv[])
17 timer_action.sa_handler = handle_vtalrm;
18 sigemptyset(&timer_action.sa_mask);
19 timer_action.sa_flags = SA_RESTART;
21 sigaction(SIGVTALRM, &timer_action, NULL);
23 timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
24 timert.it_interval.tv_usec = timert.it_value.tv_usec = 500;
25 setitimer(ITIMER_VIRTUAL, &timert, NULL);
27 struct timespec ts_initialized = {0, 1000000};
28 struct timespec* too_small = malloc(1);
30 clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts_initialized,
31 too_small);