Safe Haskell | None |
---|
Pure interface to fd_set
.
As far as I can tell, the data structure and functions in
System.Posix.IO.Select.FdSet are referentially transparent, and
it should be OK to escape the IO
monad. However, POSIX requires
that all operations on fd_set
s are done with valid file
descriptors. This can potentially be hard to ensure with lazy
evaluation in a pure setting, so for now this module bears the
unsafe label. On Linux, invalid file descriptors seem to be just
fine.
See System.Posix.IO.Select.FdSet for documentation in
general. All functions here essentially just add
unsafePerformIO
.
Documentation
insertList :: [Fd] -> FdSet -> FdSetSource
removeList :: [Fd] -> FdSet -> FdSetSource
unsafeToList :: FdSet -> [Fd]Source
This converts an FdSet
to a list by testing every file
descriptor in range for membership, which tends to involve invalid
file descriptors, giving undefined behavior according to POSIX. Use
inList
if possible.