Module posix.sys.msg
Sys V Message Queue Operations.
 Where supported by the underlying system, functions to send and receive
 interprocess messages.  If the module loads successfully, but there is
 no system support, then posix.sys.msg.version will be set, but the
 unsupported APIs wil be nil.
Functions
| msgget (key[, flags=0]) | Get a message queue identifier | 
| msgrcv (id, size, type[, flags=0]) | Receive message from a message queue | 
| msgsnd (id, type, message[, flags=0]) | Send message to a message queue | 
Constants
| posix.sys.msg | Message constants. | 
Functions
- msgget (key[, flags=0])
- 
    Get a message queue identifier
    Parameters:- key
            int
         message queue id, or IPC_PRIVATEfor a new queue
- flags
            int
         bitwise OR of zero or more from IPC_CREATandIPC_EXCL, and access permissionsS_IRUSR,S_IWUSR,S_IRGRP,S_IWGRP,S_IROTHandS_IWOTH(from posix.sys.stat) (default 0)
 Returns:- 
           int
        message queue identifier, if successful
    
 Or- nil
- string error message
- int errnum
 See also:
- key
            int
         message queue id, or 
- msgrcv (id, size, type[, flags=0])
- 
    Receive message from a message queue
    Parameters:- id int message queue identifier returned by msgget
- size int maximum message size
- type int message type (optional, default - 0)
- flags
            int
         bitwise OR of zero or more of IPC_NOWAIT,MSG_EXCEPTandMSG_NOERROR(default 0)
 Returns:Or- nil
- string error message
- int errnum
 See also:
- msgsnd (id, type, message[, flags=0])
- 
    Send message to a message queue
    Parameters:- id int message queue identifier returned by msgget
- type int arbitrary message type
- message string content
- flags
            int
         optionally IPC_NOWAIT(default 0)
 Returns:- 
           int
        0, if successful
    
 Or- nil
- string error message
- int errnum
 See also:
Constants
- posix.sys.msg
- 
    Message constants.
Any constants not available in the underlying system will be nilvalued.Fields:- IPC_CREAT int create entry if key does not exist
- IPC_EXCL int fail if key exists
- IPC_PRIVATE int private key
- IPC_NOWAIT int error if request must wait
- MSG_EXCEPT int read messages with differing type
- MSG_NOERROR int truncate received message rather than erroring
 Usage:-- Print msg constants supported on this host. for name, value in pairs (require "posix.sys.msg") do if type (value) == "number" then print (name, value) end end