diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-01-09 17:21:28 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-01-09 17:21:28 +0000 |
commit | bd5b80090e283fca902bf50d3b1e6f7981feb016 (patch) | |
tree | 0aa6cc1706ef196e034e8ad46d2cedab1a00063c /sys/compat | |
parent | 1aaf87d2640b0220becc6a49598f8a79e1e58399 (diff) | |
download | FreeBSD-src-bd5b80090e283fca902bf50d3b1e6f7981feb016.zip FreeBSD-src-bd5b80090e283fca902bf50d3b1e6f7981feb016.tar.gz |
MFC r283470:
Add EPOLLERR flag handling to epoll.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_event.c | 6 | ||||
-rw-r--r-- | sys/compat/linux/linux_event.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index d405529..4a54933 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -255,6 +255,8 @@ epoll_to_kevent(struct thread *td, struct file *epfp, *kev_flags |= EV_ONESHOT; if ((levents & LINUX_EPOLLET) != 0) *kev_flags |= EV_CLEAR; + if ((levents & LINUX_EPOLLERR) != 0) + *kev_flags |= EV_ERROR; /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { @@ -296,8 +298,10 @@ static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event) { - if ((kevent->flags & EV_ERROR) != 0) + if ((kevent->flags & EV_ERROR) != 0) { + l_event->events = LINUX_EPOLLERR; return; + } switch (kevent->filter) { case EVFILT_READ: diff --git a/sys/compat/linux/linux_event.h b/sys/compat/linux/linux_event.h index 37167ff..0c030ad 100644 --- a/sys/compat/linux/linux_event.h +++ b/sys/compat/linux/linux_event.h @@ -46,7 +46,7 @@ #define LINUX_EPOLLET 1u<<31 #define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM \ - |LINUX_EPOLLHUP|LINUX_EPOLLPRI) + |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI) #define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM) #define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \ |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR) |