|
|
HP-UX Reference > Mmq_notify(2)HP-UX 11i Version 2: December 2007 Update |
|
NAMEmq_notify() — register/cancel a notification request with a message queue DESCRIPTIONIf the argument notification is not NULL, the mq_notify() system call registers the calling process to be notified of message arrival at an empty message queue associated with the message queue descriptor mqdes. The notification specified by the notification argument will be sent to the process when the message queue transitions from the empty state to the non-empty state. At any time, only one process can be registered for notification with a message queue. If the calling process, or any other process has already registered for notification with the specified message queue, subsequent attempts to register with that queue will fail. If notification is NULL and the process is currently registered for notification with the specified message queue, the existing registration is canceled. When the notification is sent to the registered process, its registration is removed. The message queue is then available for registration. If there is some process blocked in mq_receive() waiting to receive a message from a message queue, the arrival of a message on the queue will satisfy the mq_receive(), even if the queue has a registered notification request. The resulting behavior is as if the message queue remains empty, and no notification is sent. To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line. RETURN VALUEmq_notify() returns the following values:
ERRORSIf mq_notify() fails, errno is set to one of the following values:
|
|