Skip to content

The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid

poll() is used in GHC/Event/Poll.hsc. The type of its second argument is nfds_t. nfds_t is defined unsigned long on Linux and unsigned int on Mac/FreeBSD. FFI in Poll.hsc uses CULong instead of (#type nfds_t). So, this may cause a problem on Mac/FreeBSD.

Actually, a web server compiled by GHC head on FreeBSD sometime causes the following error:

mighty-head: c_poll: invalid argument (Invalid argument)
mighty-head: sendWakeup: invalid argument (Bad file descriptor)
mighty-head: sendWakeup: invalid argument (Bad file descriptor)
mighty-head: sendWakeup: invalid argument (Bad file descriptor)

poll() on FreeBSD returns EINVAL when the specified time limit is negative.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information