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

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       mq_notify - notify process that a message is available (REALTIME)
13

SYNOPSIS

15       #include <mqueue.h>
16
17       int mq_notify(mqd_t mqdes, const struct sigevent *notification);
18
19

DESCRIPTION

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

RETURN VALUE

48       Upon successful completion, the mq_notify()  function  shall  return  a
49       value  of  zero; otherwise, the function shall return a value of -1 and
50       set errno to indicate the error.
51

ERRORS

53       The mq_notify() function shall fail if:
54
55       EBADF  The mqdes argument is not a valid message queue descriptor.
56
57       EBUSY  A process is already registered for notification by the  message
58              queue.
59
60
61       The following sections are informative.
62

EXAMPLES

64       None.
65

APPLICATION USAGE

67       None.
68

RATIONALE

70       None.
71

FUTURE DIRECTIONS

73       None.
74

SEE ALSO

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