Date: Sun, 24 May 2015 17:42:46 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283470 - head/sys/compat/linux Message-ID: <201505241742.t4OHgk59029479@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sun May 24 17:42:45 2015 New Revision: 283470 URL: https://svnweb.freebsd.org/changeset/base/283470 Log: Add EPOLLERR flag handling to epoll. Tested by: abi at abinet dot ru Modified: head/sys/compat/linux/linux_event.c head/sys/compat/linux/linux_event.h Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun May 24 17:40:14 2015 (r283469) +++ head/sys/compat/linux/linux_event.c Sun May 24 17:42:45 2015 (r283470) @@ -258,6 +258,8 @@ epoll_to_kevent(struct thread *td, struc *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) { @@ -299,8 +301,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: Modified: head/sys/compat/linux/linux_event.h ============================================================================== --- head/sys/compat/linux/linux_event.h Sun May 24 17:40:14 2015 (r283469) +++ head/sys/compat/linux/linux_event.h Sun May 24 17:42:45 2015 (r283470) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505241742.t4OHgk59029479>