mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
fix kqueue behaviour; requires special kernel patch to make kqueue
semantics consistent; from marius@umich.edu svn:r92
This commit is contained in:
parent
8a92823c67
commit
1b974101b9
4
kqueue.c
4
kqueue.c
@ -290,6 +290,10 @@ kq_add(void *arg, struct event *ev)
|
|||||||
memset(&kev, 0, sizeof(kev));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = ev->ev_fd;
|
kev.ident = ev->ev_fd;
|
||||||
kev.filter = EVFILT_READ;
|
kev.filter = EVFILT_READ;
|
||||||
|
#ifdef NOTE_EOF
|
||||||
|
/* Make it behave like select() and poll() */
|
||||||
|
kev.fflags = NOTE_EOF;
|
||||||
|
#endif
|
||||||
kev.flags = EV_ADD;
|
kev.flags = EV_ADD;
|
||||||
if (!(ev->ev_events & EV_PERSIST))
|
if (!(ev->ev_events & EV_PERSIST))
|
||||||
kev.flags |= EV_ONESHOT;
|
kev.flags |= EV_ONESHOT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user