Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 8

mq_notify()

Ask to be notified when there's a message in the queue

Synopsis:

#include <mqueue.h>

int mq_notify(
       mqd_t mqdes, 
       const struct sigevent* notification );

Arguments:

mqdes
The message-queue descriptor, returned by mq_open(), of the message queue that you want to get notification for.
notification
NULL, or a pointer to a sigevent structure that describes how you want to be notified.

Library:

Description:

If notification isn't NULL, the mq_notify() function asks the server to notify the calling process when the queue makes the transition from empty to nonempty. The means by which the server is to notify the process is passed in the sigevent structure pointed to by notification. Once the message queue server has notified the process of the transition, the notification is removed.


Note: Neutrino supports two implementations of message queues: a traditional implementation, and an alternate one that uses asynchronous messages. For more information, see the entry for mq and mqueue in the Utilities Reference.

We recommend that you use the following event types in this case:

Under normal operation, only one process may register for notification at a time. If a process attempts to attach a notification, and another process is already attached, an error is returned and errno is set to EBUSY.

If a process has registered for notification, and another process is blocked on mq_receive(), then the mq_receive() call is satisfied by any arriving message. The resulting behavior is as if the message queue remained empty.

If notification is NULL and the current process is currently registered for notification, then the existing registration is removed.

Returns:

-1 if an error occurred (errno is set). Any other value indicates success.

Errors:

EBADF
Invalid message queue mqdes.
EBUSY
A process has already registered for notification for the given queue.

Classification:

POSIX 1003.1 MSG

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

mq_open(), mq_receive(), mq_send(), sigevent

mq, mqueue in the Utilities Reference


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 210

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mq_notify.html on line 210