-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Wrap the select(2) POSIX function -- -- While tinkering on a project, I frequently found myself having to make -- FFI calls to select(2). This package provides an interface to -- that system call. It also used to expose an STM interface for running -- select(2) with alternative STM actions, but that -- functionality was split into the stm-orelse-io package from version -- 0.3. -- -- Changes in version 0.3: -- -- -- -- TODO: -- -- -- -- NOTE: I feel I'm occupying prime namespace realestate with a -- package name like select. I'll happily let myself be chased away if -- anybody else wants to use this package name. Let me know. @package select @version 0.3 -- | Some types used by the other modules in this package. module System.Posix.IO.Select.Types type Seconds = Int type Microseconds = Int -- | 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. data Timeout Never :: Timeout Time :: Seconds -> Microseconds -> Timeout -- | Interface to the select(2) POSIX function. -- -- TODO: -- -- module System.Posix.IO.Select -- | 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. select :: [Fd] -> [Fd] -> [Fd] -> Timeout -> IO CInt -- | 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. data Timeout Never :: Timeout Time :: Seconds -> Microseconds -> Timeout