kqueue-0.2.1: A binding to the kqueue event library.

Safe HaskellSafe
LanguageHaskell2010

System.KQueue

Description

This module contains a low-level binding to the kqueue interface. It stays close to the C API, changing the types to more native Haskell types, but not significantly changing it. See the kqueue man page or the examples in examples/ for usage information. For a higher-level binding, see System.KQueue.HighLevel.

Synopsis

Documentation

data KQueue Source #

A kernel event queue.

kqueue :: IO KQueue Source #

Create a new KQueue.

data KEvent Source #

A kernel event.

Constructors

KEvent 

Fields

data Flag Source #

The actions to perform on the event.

Instances

Enum Flag Source # 

Methods

succ :: Flag -> Flag #

pred :: Flag -> Flag #

toEnum :: Int -> Flag #

fromEnum :: Flag -> Int #

enumFrom :: Flag -> [Flag] #

enumFromThen :: Flag -> Flag -> [Flag] #

enumFromTo :: Flag -> Flag -> [Flag] #

enumFromThenTo :: Flag -> Flag -> Flag -> [Flag] #

Eq Flag Source # 

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Show Flag Source # 

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

kevent Source #

Arguments

:: KQueue

The kernel queue to operate on.

-> [KEvent]

The list of events to start monitoring, or changes to retrieve.

-> Int

The maximum number of events to retrieve.

-> Maybe NominalDiffTime

Timeout. When nothing, blocks until an event has occurred.

-> IO [KEvent]

A list of events that have occurred.

Add events to monitor, or retrieve events from the kqueue. If an error occurs, will throw a KQueueException if there is no room in the returned event list. Otherwise, will set EvError on the event and add it to the returned event list.