FFI to poll()

Ian Lynagh ian at well-typed.com
Sat Feb 23 03:55:46 CET 2013


Hi Kazu,

On Sat, Feb 23, 2013 at 11:42:07AM +0900, Kazu Yamamoto wrote:
> 
> I'm now looking into a bug of the poll backend.

Great!

> 	foreign import ccall safe "poll.h poll"
> 	    c_poll :: Ptr PollFd -> CULong -> CInt -> IO CInt
> 
> The second argument is defined unsigned long on Linux. However, it is
> unsigned int on Mac and FreeBSD. I think this is a source of the bug
> which I'm looking into.
> 
> But this is not generic enough. Any suggestions to fix this?

According to my manpage, it's an nfds_t. Is that type as portable as
poll is?


Thanks
Ian




More information about the ghc-devs mailing list