From 61dea7f52b98fc0d3134998e867e8fa1a1e80273 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sun, 28 Apr 2019 11:30:14 -0600
Subject: [PATCH] Add all 3 epoll_ctl ops

---
 src/platform/redox/epoll.rs | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/platform/redox/epoll.rs b/src/platform/redox/epoll.rs
index 5dd0bca16..c47fad0ac 100644
--- a/src/platform/redox/epoll.rs
+++ b/src/platform/redox/epoll.rs
@@ -24,20 +24,33 @@ impl PalEpoll for Sys {
 
     fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut epoll_event) -> c_int {
         match op {
-            EPOLL_CTL_ADD => {
+            EPOLL_CTL_ADD | EPOLL_CTL_MOD => {
                 Sys::write(
                     epfd,
                     &Event {
                         id: fd as usize,
                         flags: unsafe { (*event).events as usize },
-
                         // NOTE: Danger when using non 64-bit systems. If this is
                         // needed, use a box or something
                         data: unsafe { mem::transmute((*event).data) },
                     },
                 ) as c_int
             },
-            _ => unimplemented!()
+            EPOLL_CTL_DEL => {
+                Sys::write(
+                    epfd,
+                    &Event {
+                        id: fd as usize,
+                        flags: 0,
+                        //TODO: Is data required?
+                        data: 0,
+                    },
+                ) as c_int
+            },
+            _ => {
+                platform::errno = errno::EINVAL;
+                return -1;
+            }
         }
     }
 
-- 
GitLab