From dd328baad87373af0a575463b480edcd5d21d7d5 Mon Sep 17 00:00:00 2001
From: patacongo User's Manual by Gregory Nutt
- Last Updated: July 19, 2011 Last Updated: December 5, 2011
-Function Prototype:
+ Function Prototype:
NuttX Operating System
2.4.7 mq_notify
#include <mqueue.h>
int mq_notify(mqd_t mqdes, const struct sigevent *notification);
-
+
-Description: If the "notification" input parameter
-is not NULL, this function connects the task with the message queue such
-that the specified signal will be sent to the task whenever the message
-changes from empty to non-empty. One notification can be attached
-to a message queue.
+ Description: If the notification
input parameter
+ is not NULL
, this function connects the task with the message queue such
+ that the specified signal will be sent to the task whenever the message
+ changes from empty to non-empty. One notification can be attached
+ to a message queue.
+
-If "notification" is NULL, the attached notification
-is detached (if it was held by the calling task) and the queue
-is available to attach another notification.
+ If notification
; is NULL
, the attached notification
+ is detached (if it was held by the calling task) and the queue
+ is available to attach another notification.
+
-When the notification is sent to the registered task, its registration -will be removed. The message queue will then be available for -registration. + When the notification is sent to the registered task, its registration + will be removed. The message queue will then be available for + registration.
-Input Parameters: -
mqdes
. Message queue descriptor
+ notification
. Real-time signal structure containing:
+ sigev_notify
. Should be SIGEV_SIGNAL (but actually ignored)
+ sigev_signo
. The signo to use for the notification
+ sigev_value
. Value associated with the signal
+
-Returned Values: None.
+ Returned Values:
+ On success mq_notify()
returns 0; on error, -1 is returned, with
+ errno
set to indicate the error:
+
EBADF
. The descriptor specified in mqdes
is invalid.
+ EBUSY
. Another process has already registered to receive notification
+ for this message queue.
+ EINVAL
. sevp->sigev_notify
is not one of the permitted values; or
+ sevp->sigev_notify
is SIGEV_SIGNAL
and sevp->sigev_signo
is not a
+ valid signal number.
+ ENOMEM
. Insufficient memory.
+ -Assumptions/Limitations: + Assumptions/Limitations: +
- POSIX Compatibility: Comparable to the POSIX interface -of the same name. -Differences from the full POSIX implementation include: -