udev-0.1.0.0: libudev bindings

Portabilityportable
Stabilityexperimental
Maintainerpxqr.sta@gmail.com
Safe HaskellNone

System.UDev.Monitor

Contents

Description

Connects to a device event source.

Synopsis

Documentation

data Monitor Source

Opaque object handling an event source.

Instances

Creation

data SourceId Source

Event source identifier.

Constructors

KernelId

Events are sent out just after kernel processes them.

Applications should usually not connect directly to the "kernel" events, because the devices might not be useable at that time, before udev has configured them, and created device nodes. Use UDevId instead.

UDevId

Events are sent out after udev has finished its event processing, all rules have been processed, and needed device nodes are created.

OtherId BS.ByteString

For extensibility.

newFromNetlink :: UDev -> SourceId -> IO MonitorSource

Create new udev monitor and connect to a specified event source.

Receiving

enableReceiving :: Monitor -> IO ()Source

Binds the Monitor socket to the event source.

setReceiveBufferSize :: Monitor -> Int -> IO ()Source

Set the size of the kernel socket buffer.

getFd :: Monitor -> IO FdSource

Retrieve the socket file descriptor associated with the monitor.

getHandle :: Monitor -> IO HandleSource

Similar to getFd but retrieves the socket handle associated with the monitor.

receiveDevice :: Monitor -> IO DeviceSource

Receive data from the udev monitor socket, allocate a new udev device, fill in the received data, and return the device.

Filter

filterAddMatchSubsystemDevtype :: Monitor -> BS.ByteString -> BS.ByteString -> IO ()Source

Filter events by subsystem and device type.

The filter must be installed before the monitor is switched to listening mode.

filterAddMatchTag :: Monitor -> BS.ByteString -> IO ()Source

The filter must be installed before the monitor is switched to listening mode.

filterUpdate :: Monitor -> IO ()Source

Update the installed socket filter. This is only needed, if the filter was removed or changed.

filterRemove :: Monitor -> IO ()Source

Remove all filters from monitor.