aboutsummaryrefslogblamecommitdiffstats
path: root/tests/signal.c
blob: a68edcd08ca93a6cb756775f12d744b5aae9c079 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                   
                 










                                
                                             

                                  
                             


                                 
#include <signal.h>
#include <time.h>
#include <unistd.h>

static void
interrupt()
{
	write(-2, "xyzzy\n", 6);
}

int
main(void)
{
	struct timespec ts = {0, 100000000L};
	signal(SIGINT, interrupt);
	kill(getpid(), SIGINT);
	nanosleep(&ts, NULL);
	write(-1, "qwerty\n", 7);
	return 0;
}