diff --git a/devicemodel/core/mevent.c b/devicemodel/core/mevent.c index c5c1f3b29..816c4288d 100644 --- a/devicemodel/core/mevent.c +++ b/devicemodel/core/mevent.c @@ -122,9 +122,15 @@ mevent_kq_filter(struct mevent *mevp) if (mevp->me_type == EVF_READ) retval = EPOLLIN; + if (mevp->me_type == EVF_READ_ET) + retval = EPOLLIN | EPOLLET; + if (mevp->me_type == EVF_WRITE) retval = EPOLLOUT; + if (mevp->me_type == EVF_WRITE_ET) + retval = EPOLLOUT | EPOLLET; + return retval; } @@ -142,8 +148,11 @@ mevent_destroy(void) ee.data.ptr = mevp; epoll_ctl(epoll_fd, EPOLL_CTL_DEL, mevp->me_fd, &ee); - if ((mevp->me_type == EVF_READ || mevp->me_type == EVF_WRITE) && - mevp->me_fd != STDIN_FILENO) + if ((mevp->me_type == EVF_READ || + mevp->me_type == EVF_READ_ET || + mevp->me_type == EVF_WRITE || + mevp->me_type == EVF_WRITE_ET) && + mevp->me_fd != STDIN_FILENO) close(mevp->me_fd); free(mevp); diff --git a/devicemodel/include/mevent.h b/devicemodel/include/mevent.h index 6ae4a41a0..0aa7ab3a0 100644 --- a/devicemodel/include/mevent.h +++ b/devicemodel/include/mevent.h @@ -32,6 +32,8 @@ enum ev_type { EVF_READ, EVF_WRITE, + EVF_READ_ET, + EVF_WRITE_ET, EVF_TIMER, /* Not supported yet */ EVF_SIGNAL /* Not supported yet */ };