MsgQueueCtl()
QNX SDP8.0C Library ReferenceAPIDeveloper
Perform message queue operations
Synopsis:
#include <sys/neutrino.h>
int MsgQueueCtl( int fd,
int cmd,
void* data );
Arguments:
- fd
- The open queue descriptor, as obtained with mq_open().
- cmd
-
The operation to perform, specified by one the following constants:
- _NTO_MQCTL_NOTIFY — Register the caller for notification when the queue identified by fd transitions from an empty to non-empty state. In this case, data must be a pointer to a sigevent structure.
- _NTO_MQCTL_GETATTR — Fill in an mq_attr structure with the queue attributes (see mq_getattr() for information about the contents of the mq_attr structure).
- _NTO_MQCTL_SETATTR — Change the attributes of a message queue.
- data
- A pointer to a sigevent for _NTO_MQCTL_NOTIFY; a pointer to a struct mq_attr for _NTO_MQCTL_GETATTR and _NTO_MQCTL_SETATTR.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The MsgQueueCtl() function is used to perform operations on message queues. These operations include registering for notifications, querying queue attributes, and changing the blocking state of the queue connection.
Note:
This kernel call is used to implement the C library functions mq_notify(), mq_getattr(), and mq_setattr(). It should not be used directly.
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Errors:
- ENOSYS
- An unsupported command was specified.
- EBADF
- The queue descriptor does not correspond to an open queue.
- EBUSY
- _NTO_MQCTL_NOTIFY attempted to add a notification for a queue where a notification already exists.
- EINVAL
- _NTO_MQCTL_NOTIFY attempted to remove a notification that was added by a different process.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |
Page updated: