blob: 8c54f4d0e9da150312686f20d27f8124be86623d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/* ISC license. */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <unistd.h>
int main (void)
{
int q = kqueue() ;
struct kevent ke ;
struct timespec ts = { .tv_sec = 1, .tv_nsec = 0 } ;
EV_SET(&ke, getpid(), EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, 0) ;
kevent(q, &ke, 1, &ke, 1, &ts) ;
return 0 ;
}
|