none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git] / none / tests / x86-freebsd / 445032.c
blob6fe828cb4d48613bfd4358fb8c8bf269bdab5a02
1 #include <fcntl.h>
2 #include <signal.h>
3 #include <stdio.h>
4 #include <sys/time.h>
5 #include <unistd.h>
7 volatile int ticks = 0;
8 struct itimerval timert;
9 struct sigaction timer_action;
12 void handle_vtalrm(int sig) {
13 ticks++;
16 void setup_timer() {
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 = 100;
25 setitimer(ITIMER_VIRTUAL, &timert, NULL);
28 int main(int argc, char *argv[]) {
29 setup_timer();
30 sleep(5);