select-0.3: Wrap the select(2) POSIX function

Safe HaskellNone



Interface to the select(2) POSIX function.


  • Make a version of select that shows which file descriptors are ready. (Needs a type for fd_set that can be passed to and from C).



select :: [Fd] -> [Fd] -> [Fd] -> Timeout -> IO CIntSource

select readFds writeFds exceptFds timeout calls the select(2) function with the file descriptors in readFds as the FD set to watch for read readiness, and similarly for writeFds and exceptFds, with timeout specifying the timeout. The return value is that of the call.

data Timeout Source

A timeout of Never tells select(2) to never time out, while Time s us sets the timeout parameters to s seconds and us microseconds.