Date: Sat, 9 Jan 2016 18:23:34 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293606 - stable/10/sys/compat/linux Message-ID: <201601091823.u09INY4F078297@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Jan 9 18:23:34 2016 New Revision: 293606 URL: https://svnweb.freebsd.org/changeset/base/293606 Log: MFC r284626: Add EPOLLRDHUP support. Modified: stable/10/sys/compat/linux/linux_event.c stable/10/sys/compat/linux/linux_event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jan 9 18:22:09 2016 (r293605) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 18:23:34 2016 (r293606) @@ -257,6 +257,8 @@ epoll_to_kevent(struct thread *td, struc *kev_flags |= EV_CLEAR; if ((levents & LINUX_EPOLLERR) != 0) *kev_flags |= EV_ERROR; + if ((levents & LINUX_EPOLLRDHUP) != 0) + *kev_flags |= EV_EOF; /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { @@ -306,6 +308,8 @@ kevent_to_epoll(struct kevent *kevent, s switch (kevent->filter) { case EVFILT_READ: l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI; + if ((kevent->flags & EV_EOF) != 0) + l_event->events |= LINUX_EPOLLRDHUP; break; case EVFILT_WRITE: l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM; Modified: stable/10/sys/compat/linux/linux_event.h ============================================================================== --- stable/10/sys/compat/linux/linux_event.h Sat Jan 9 18:22:09 2016 (r293605) +++ stable/10/sys/compat/linux/linux_event.h Sat Jan 9 18:23:34 2016 (r293606) @@ -49,7 +49,7 @@ |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) + |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR|LINUX_EPOLLRDHUP) #define LINUX_EPOLL_CTL_ADD 1 #define LINUX_EPOLL_CTL_DEL 2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091823.u09INY4F078297>