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

Safe HaskellSafe
LanguageHaskell98

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

A kernel event queue.

kqueue :: IO KQueue

Create a new KQueue.

data KEvent

A kernel event.

Constructors

KEvent 

Fields

ident :: CUInt

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_ :: CInt

Filter-specific data value.

udata :: Ptr ()

User-defined data, passed through unchanged.

data Filter

The types of kernel events.

data Flag

The actions to perform on the event.

Instances

data FFlag

The filter specific flags.

Instances

kevent

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.