13 fprintf(stderr, "%s\n", s);
17 static int my_sig, retval;
19 static volatile sig_atomic_t flag;
22 sighandler(const int s, siginfo_t *i, void *x)
26 retval = *(int*)i->si_ptr;
31 main(int argc, char *argv[])
38 my_sig = atoi(argv[1]);
39 printf("SIGRTMIN=%d SIGRTMAX=%d\n", SIGRTMIN, SIGRTMAX);
41 fd = open("MANIFEST", O_RDONLY);
43 die("can't open MANIFEST");
48 a.aio_buf = malloc(100);
50 a.aio_sigevent.sigev_notify = SIGEV_SIGNAL;
51 a.aio_sigevent.sigev_signo = my_sig;
52 a.aio_sigevent.sigev_value.sival_ptr = &i;
53 sa.sa_sigaction = sighandler;
54 sigemptyset(&sa.sa_mask);
55 sa.sa_flags = SA_RESTART|SA_SIGINFO;
56 if (sigaction(my_sig, &sa, NULL) < 0)
66 printf("INFO=%d\n", retval);