MsgQueueClose()
Close a message queue connection
Synopsis:
#include <sys/neutrino.h>
int MsgQueueClose( rcvid_t rcvid,
int queueid );
Arguments:
- rcvid
- The receive ID associated with a close request that a message queue manager has received, or -1 to remove the creation reference from the queue.
- queueid
- The identifier of the message queue.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The MsgQueueClose() function is used by message queue managers to clean up a reference to an in-kernel message queue. If called with a rcvid that is a valid receive ID (not -1), the function disconnects the client's coid (identified by the rcvid) from the message queue and unblocks any client threads that might be blocked on that coid, providing implementation semantics for mq_close(). If called with a rcvid value of -1, the MsgQueueClose() function removes the creation reference for the message queue, providing implementation semantics for mq_unlink().
On the removal of the last reference to the queue, the queue object will be cleaned up.
If the resource manager managing any queues exits, then the creation reference for each queue it managed is automatically removed.
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Errors:
- EBADF
- The rcvid is not -1 and does not identify an existing connection.
- EINVAL
- The queueid is not a valid queue.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |