2012-03-15 23:04:46 +04:00
|
|
|
.\" $NetBSD: mq_notify.3,v 1.3 2012/03/15 19:04:47 njoly Exp $
|
2009-01-06 00:19:48 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
|
|
|
|
.\"
|
2010-06-07 11:21:52 +04:00
|
|
|
.Dd June 7, 2010
|
2009-01-06 00:19:48 +03:00
|
|
|
.Dt MQ_NOTIFY 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mq_notify
|
|
|
|
.Nd notify process that a message is available (REALTIME)
|
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb librt
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In mqueue.h
|
|
|
|
.Ft int
|
|
|
|
.Fn mq_notify "mqd_t mqdes" "const struct sigevent *notification"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
If the argument
|
|
|
|
.Fa notification
|
|
|
|
is not
|
|
|
|
.Dv NULL ,
|
|
|
|
this function will register the calling process to be notified of
|
|
|
|
message arrival at an empty message queue associated with the
|
|
|
|
specified message queue descriptor,
|
|
|
|
.Fa mqdes .
|
|
|
|
The notification specified by the
|
|
|
|
.Fa notification
|
|
|
|
argument will be sent to the process when the message queue
|
|
|
|
transitions from empty to non-empty.
|
|
|
|
At any time, only one process may be registered for notification
|
|
|
|
by a message queue.
|
|
|
|
If the calling process or any other process has already registered
|
|
|
|
for notification of message arrival at the specified message queue,
|
|
|
|
subsequent attempts to register for that message queue fails.
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Fa notification
|
|
|
|
is
|
|
|
|
.Dv NULL
|
|
|
|
and the process is currently registered for notification by the
|
|
|
|
specified message queue, the existing registration will be removed.
|
|
|
|
.Pp
|
|
|
|
When the notification is sent to the registered process,
|
|
|
|
its registration will be removed.
|
|
|
|
The message queue will then be available for registration.
|
|
|
|
.Pp
|
|
|
|
If a process has registered for notification of message arrival
|
|
|
|
at a message queue and some thread is blocked in
|
|
|
|
.Fn mq_receive
|
|
|
|
waiting to receive a message when a message arrives at the queue,
|
|
|
|
the arriving message will satisfy the appropriate
|
|
|
|
.Fn mq_receive .
|
|
|
|
The resulting behavior is as if the message queue remains empty,
|
|
|
|
and no notification will be sent.
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
.Rv -std mq_notify
|
|
|
|
.Sh ERRORS
|
|
|
|
The
|
|
|
|
.Fn mq_notify
|
|
|
|
function fails if:
|
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EBADF
|
|
|
|
The
|
|
|
|
.Fa mqdes
|
|
|
|
argument is not a valid message queue descriptor.
|
|
|
|
.It Bq Er EBUSY
|
|
|
|
A process is already registered for notification by the message queue.
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
2010-06-07 11:21:52 +04:00
|
|
|
.Xr mq 3 ,
|
|
|
|
.Xr sigevent 3
|
2009-01-06 00:19:48 +03:00
|
|
|
.Sh STANDARDS
|
|
|
|
This function conforms to the
|
|
|
|
.St -p1003.1-2001
|
|
|
|
standard.
|
|
|
|
.Sh HISTORY
|
|
|
|
This function first appeared in
|
|
|
|
.Nx 5.0 .
|
|
|
|
.Sh COPYRIGHT
|
|
|
|
Portions of this text are reprinted and reproduced in electronic form
|
|
|
|
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
|
|
|
|
-- Portable Operating System Interface (POSIX), The Open Group Base
|
|
|
|
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
|
|
|
|
Electrical and Electronics Engineers, Inc and The Open Group.
|
|
|
|
In the
|
|
|
|
event of any discrepancy between this version and the original IEEE and
|
|
|
|
The Open Group Standard, the original IEEE and The Open Group Standard
|
|
|
|
is the referee document.
|
|
|
|
The original Standard can be obtained online at
|
2012-03-15 23:04:46 +04:00
|
|
|
.Lk http://www.opengroup.org/unix/online.html .
|