hsdns-1.1Source codeContentsIndex
PortabilityHaskell 2-pre
A foreign function interface to the POSIX system call poll(2). Your program should link the threaded runtime-system when using this module in blocking fashion.
data Pollfd = Pollfd Fd CShort CShort
data PollFlag
= PollIn
| PollPri
| PollOut
| PollErr
| PollHup
| PollNVal
poll :: Ptr Pollfd -> CUInt -> CInt -> IO CInt
data Pollfd Source

The marshaled version of:

 struct pollfd
   int fd;           /* file descriptor */
   short events;     /* requested events */
   short revents;    /* returned events */
Pollfd Fd CShort CShort
show/hide Instances
data PollFlag Source
Marshaled Enum representing the various poll(2) flags.
PollInthere is data to read
PollPrithere is urgent data to read
PollOutwriting now will not block
PollErrerror condition
PollHuphung up
PollNValinvalid request: fd not open
show/hide Instances
poll :: Ptr Pollfd -> CUInt -> CInt -> IO CIntSource

The system routine poll(2) may block, obviously; so it is declared as a "safe" FFI call. In the threaded runtime-system, this means that a blocking invocation of poll will not block any other execution threads. Thus, you should link your programs with -threaded when you use this module. Further details can be found at http://www.haskell.org//pipermail/glasgow-haskell-users/2005-February/007762.html.

In the non-threaded runtime-system, using poll in blocking fashion will block all other threads too.

Produced by Haddock version 2.4.2