Copyright | (c) The University of Glasgow 2002 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | William N. Halchin (vigalchin@gmail.com) |
Stability | provisional |
Portability | non-portable (requires POSIX) |
Safe Haskell | None |
Language | Haskell98 |
POSIX 1003.1b message queue support. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html.
- data MQAttributes = MQAttributes {
- flags :: Int
- maxMsgNum :: Int
- maxMsgSize :: Int
- curNumMsgs :: Int
- type Name = String
- mqOpen :: Name -> OpenMode -> Maybe FileMode -> Maybe MQAttributes -> IO Fd
- mqClose :: Fd -> IO ()
- mqUnlink :: String -> IO ()
- mqSend :: Fd -> ByteString -> ByteCount -> Int -> IO ()
- mqReceive :: Fd -> ByteCount -> Maybe Int -> IO (ByteString, Int)
- mqGetAttributes :: Fd -> IO MQAttributes
- mqSetAttributes :: Fd -> MQAttributes -> IO MQAttributes
- mqNotify :: Fd -> Maybe Sigevent -> IO ()
Message queue attributes data type
data MQAttributes Source
MQAttributes | |
|
Show MQAttributes Source | |
Storable MQAttributes Source | MQAttributes Storable used to marshall and unmarshall to ANSI C |
Opening/closing/unlinking mqueues
:: Name | |
-> OpenMode | |
-> Maybe FileMode |
|
-> Maybe MQAttributes |
|
-> 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.
Sending/receiving data
Programmers using the mqSend
and mqReceive
API should be aware that
EAGAIN exceptions may occur for non-blocking IO!
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