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

Safe HaskellNone

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 KQueueSource

Create a new KQueue.

data KEvent Source

A kernel event.

Constructors

KEvent 

Fields

ident :: CULong

The identifier for the event, often a file descriptor.

evfilter :: Filter

The kernel filter (type of event).

flags :: [Flag]

Actions to perform on the event.

fflags :: [FFlag]

Filter-specific flags.

data_ :: CLong

Filter-specific data value.

udata :: Ptr ()

User-defined data, passed through unchanged.

data Filter Source

The types of kernel events.

data Flag Source

The actions to perform on the event.

Instances

keventSource

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.