1MQ_NOTIFY(P)               POSIX Programmer's Manual              MQ_NOTIFY(P)
2
3
4

NAME

6       mq_notify - notify process that a message is available (REALTIME)
7

SYNOPSIS

9       #include <mqueue.h>
10
11       int mq_notify(mqd_t mqdes, const struct sigevent *notification);
12
13

DESCRIPTION

15       If  the argument notification is not NULL, this function shall register
16       the calling process to be notified of message arrival at an empty  mes‐
17       sage  queue  associated  with  the  specified message queue descriptor,
18       mqdes. The notification specified by the notification argument shall be
19       sent  to  the  process when the message queue transitions from empty to
20       non-empty. At any time, only one process may be registered for  notifi‐
21       cation  by a message queue. If the calling process or any other process
22       has already registered for notification of message arrival at the spec‐
23       ified  message  queue, subsequent attempts to register for that message
24       queue shall fail.
25
26       If notification is NULL and the process  is  currently  registered  for
27       notification  by the specified message queue, the existing registration
28       shall be removed.
29
30       When the notification is sent to the registered process, its  registra‐
31       tion  shall  be  removed. The message queue shall then be available for
32       registration.
33
34       If a process has registered for notification of message  arrival  at  a
35       message  queue  and  some  thread is blocked in mq_receive() waiting to
36       receive a message when a message arrives at  the  queue,  the  arriving
37       message  shall  satisfy  the  appropriate  mq_receive().  The resulting
38       behavior is as if the message queue remains empty, and no  notification
39       shall be sent.
40

RETURN VALUE

42       Upon  successful  completion,  the  mq_notify() function shall return a
43       value of zero; otherwise, the function shall return a value of  -1  and
44       set errno to indicate the error.
45

ERRORS

47       The mq_notify() function shall fail if:
48
49       EBADF  The mqdes argument is not a valid message queue descriptor.
50
51       EBUSY  A  process is already registered for notification by the message
52              queue.
53
54
55       The following sections are informative.
56

EXAMPLES

58       None.
59

APPLICATION USAGE

61       None.
62

RATIONALE

64       None.
65

FUTURE DIRECTIONS

67       None.
68

SEE ALSO

70       mq_open() , mq_send() , mq_timedsend() , msgctl() , msgget() , msgrcv()
71       ,  msgsnd()  ,  the  Base  Definitions  volume of IEEE Std 1003.1-2001,
72       <mqueue.h>
73
75       Portions of this text are reprinted and reproduced in  electronic  form
76       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
77       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
78       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
79       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
80       event of any discrepancy between this version and the original IEEE and
81       The Open Group Standard, the original IEEE and The Open Group  Standard
82       is  the  referee document. The original Standard can be obtained online
83       at http://www.opengroup.org/unix/online.html .
84
85
86
87IEEE/The Open Group                  2003                         MQ_NOTIFY(P)
Impressum