MsgQueueOpen()
QNX SDP8.0C Library ReferenceAPIDeveloper
Associate a client with a kernel message queue
Synopsis:
#include <sys/neutrino.h>
int MsgQueueOpen( rcvid_t rcvid,
                  int queueid,
                  uint32_t msgsize,
                  uint32_t maxmsg,
                  unsigned oflag );
Arguments:
- rcvid
 - The receive ID associated with an open request that a message queue manager has received.
 - queueid
 - The identifier of the message queue. Specify a non-negative integer to open an existing queue or -1 to create a new queue.
 - msgsize
 - The maximum size of messages that can be sent or received on the message queue.
 - maxmsg
 - The maximum number of messages that the message queue can hold.
 - oflag
 - Flags specifying the behavior of the open operation:
      
- _IO_FLAG_RD—open the connection for reading.
 - _IO_FLAG_WR—open the connection for writing.
 - O_NONBLOCK —specify non-blocking queue access.
 
 
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The MsgQueueOpen() function is used by message queue managers to connect a client to a message queue in response to an mq_open() call. It performs the necessary steps for locating the queue (and creates it if necessary), creates a new connection between the client (identified by rcvid) of the caller and the queue object, and stores the relevant flags for subsequent operations.
Returns:
- ≥0
 - If the queueid argument was -1, the ID of the newly created message queue. Otherwise, 0 to indicate that the queue specified by queueid was successfully opened.
 - -1
 - An error occurred (errno is set).
 
Errors:
- EAGAIN
 - There are too many queues.
 - EBUSY
 - The file descriptor in fd is already associated with a queue.
 - EINVAL
 - An argument was invalid.
 - ENOSPC
 - There's insufficient memory for a new queue.
 - EPERM
 - The process tried to create a new queue without having the required permission; go to Abilities.
 - ESRCH
 - The queue specified by queueid doesn't exist.
 
Classification:
| Safety: | |
|---|---|
| Cancellation point | No | 
| Signal handler | Yes | 
| Thread | Yes | 
Page updated: 
