#5005: epollCreate: unsupported operation (Function not implemented)
---------------------------------+------------------------------------------
    Reporter:  nomeata           |       Owner:                    
        Type:  bug               |      Status:  new               
    Priority:  normal            |   Component:  Compiler          
     Version:  7.0.2             |    Keywords:                    
    Testcase:                    |   Blockedby:                    
          Os:  Linux             |    Blocking:                    
Architecture:  Unknown/Multiple  |     Failure:  Compile-time crash
---------------------------------+------------------------------------------

Comment(by tibbe):

 Perhaps we could change this to (untested):

 {{{
 import Foreign.C.Error (eNOSYS, throwErrno, getErrno)

 epollCreate :: IO EPollFd
 epollCreate = do
 #if defined(HAVE_EPOLL_CREATE1)
   fd <- c_epoll_create1 (#const EPOLL_CLOEXEC)
   if fd == -1
     then do
       errno <- getErrno
       if errno == eNOSYS
         then legacyCreate
         else throwErrno
     else return fd
 #else
   legacyCreate
 #endif
   let !epollFd' = EPollFd fd
   return epollFd'
  where
   legacyCreate = do
     fd <- throwErrnoIfMinus1 "epollCreate" $
           c_epoll_create 256 -- argument is ignored
     setCloseOnExec fd
 }}}

 Could someone please test and see if this works?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5005#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to