posix-realtime-0.0.0.4: POSIX Realtime functionality

Copyright(c) The University of Glasgow 2002
LicenseBSD-style (see the file libraries/base/LICENSE)
MaintainerWilliam N. Halchin (vigalchin@gmail.com)
Stabilityprovisional
Portabilitynon-portable (requires POSIX)
Safe HaskellNone
LanguageHaskell98

System.Posix.Realtime.MQueue

Contents

Description

Synopsis

Message queue attributes data type

data MQAttributes Source

Constructors

MQAttributes 

Instances

Show MQAttributes Source 
Storable MQAttributes Source

MQAttributes Storable used to marshall and unmarshall to ANSI C

Opening/closing/unlinking mqueues

mqOpen Source

Arguments

:: Name 
-> OpenMode 
-> Maybe FileMode

Just x creates the queue with the given modes, Nothing then the file must exist.

-> Maybe MQAttributes

Just x creates the queue with given attributes, Nothing with default attributes.

-> IO Fd 

Open and optionally create a message queue

Note: The POSIX standard puts some constraints on Name but leaves much as "implementation-defined", meaning that one needs to read the system-specific details on what a conforming name should look like.

mqClose :: Fd -> IO () Source

Close a message queue

mqUnlink :: String -> IO () Source

Unlink (destroy) an existing message queue

Sending/receiving data

Programmers using the mqSend and mqReceive API should be aware that EAGAIN exceptions may occur for non-blocking IO!

mqSend :: Fd -> ByteString -> ByteCount -> Int -> IO () Source

Send a message on a message queue

mqReceive :: Fd -> ByteCount -> Maybe Int -> IO (ByteString, Int) Source

Retrieve a message from a message queue

Note: mq_timedreceive is not exposed, wrap mqReceive in timeout to get a timed receive.

Getting/Setting mqueue attributes

mqGetAttributes :: Fd -> IO MQAttributes Source

Get the attributes for an existing message queue

mqSetAttributes :: Fd -> MQAttributes -> IO MQAttributes Source

Set the attributes for an existing message queue and its retrieve old attributes

Notify receipt of message

mqNotify :: Fd -> Maybe Sigevent -> IO () Source

Notify a registered process of the new-message-in-empty-queue event