3 * cc -I/usr/local/include -o signal-test \
4 * signal-test.c -L/usr/local/lib -levent
15 #include <sys/queue.h>
33 signal_cb(int fd
, short event
, void *arg
)
35 struct event
*signal
= arg
;
37 printf("%s: got signal %d\n", __func__
, EVENT_SIGNAL(signal
));
46 main (int argc
, char **argv
)
48 struct event signal_int
;
50 /* Initalize the event library */
53 /* Initalize one event */
54 event_set(&signal_int
, SIGINT
, EV_SIGNAL
|EV_PERSIST
, signal_cb
,
57 event_add(&signal_int
, NULL
);