X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FEvent%2FEPoll.hsc;h=f30c4bd419932d17bdde082f64c6c838c2b4a514;hb=a6ad1ebfcad259e9b8ba60c32ab04437e328f54a;hp=b2311c8940bb209b77ef492237870c6246c81d8b;hpb=5a984d7cfa6cc8d7d57c83d12e439d9015564761;p=ghc-base.git diff --git a/System/Event/EPoll.hsc b/System/Event/EPoll.hsc index b2311c8..f30c4bd 100644 --- a/System/Event/EPoll.hsc +++ b/System/Event/EPoll.hsc @@ -51,9 +51,7 @@ import GHC.Num (Num(..)) import GHC.Real (ceiling, fromIntegral) import GHC.Show (Show) import System.Posix.Internals (c_close) -#if !defined(HAVE_EPOLL_CREATE1) import System.Posix.Internals (setCloseOnExec) -#endif import System.Posix.Types (Fd(..)) import qualified System.Event.Array as A @@ -163,12 +161,8 @@ newtype EventType = EventType { epollCreate :: IO EPollFd epollCreate = do fd <- throwErrnoIfMinus1 "epollCreate" $ -#if defined(HAVE_EPOLL_CREATE1) - c_epoll_create1 (#const EPOLL_CLOEXEC) -#else c_epoll_create 256 -- argument is ignored setCloseOnExec fd -#endif let !epollFd' = EPollFd fd return epollFd' @@ -200,13 +194,8 @@ fromTimeout :: Timeout -> Int fromTimeout Forever = -1 fromTimeout (Timeout s) = ceiling $ 1000 * s -#if defined(HAVE_EPOLL_CREATE1) -foreign import ccall unsafe "sys/epoll.h epoll_create1" - c_epoll_create1 :: CInt -> IO CInt -#else foreign import ccall unsafe "sys/epoll.h epoll_create" c_epoll_create :: CInt -> IO CInt -#endif foreign import ccall unsafe "sys/epoll.h epoll_ctl" c_epoll_ctl :: CInt -> CInt -> CInt -> Ptr Event -> IO CInt