NetBSD/lib/librt/mq_notify.3
rmind 57babc4980 Manuals describing the interface of POSIX message queues.
Taken from The Open Group, with various modifications.
Thanks <wiz> for improvements!
2009-01-05 21:19:48 +00:00

96 lines
2.8 KiB
Groff

.\" $NetBSD: mq_notify.3,v 1.1 2009/01/05 21:19:49 rmind Exp $
.\"
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.\"
.Dd January 5, 2009
.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
.Xr mq_close 3 ,
.Xr mq_getattr 3 ,
.Xr mq_open 3 ,
.Xr mq_receive 3 ,
.Xr mq_send 3 ,
.Xr mq_setattr 3 ,
.Xr mq_unlink 3
.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
http://www.opengroup.org/unix/online.html .