3 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
9 .Nm mq_send , mq_timedsend
10 .Nd send a message to a message queue (REALTIME)
18 .Fa "const char *msg_ptr"
20 .Fa "unsigned msg_prio"
27 .Fa "const char *msg_ptr"
29 .Fa "unsigned msg_prio"
30 .Fa "const struct timespec *abs_timeout"
35 function will add the message pointed to by the argument
37 to the message queue specified by
41 argument specifies the length of the message, in bytes, pointed to by
45 will be less than or equal to the
47 attribute of the message queue, or
51 If the specified message queue is not full,
53 behaves as if the message is inserted into the message queue at the
54 position indicated by the
57 A message with a larger numeric value of
59 will be inserted before messages with lower values of
61 A message will be inserted after other messages in the queue,
69 If the specified message queue is full and
71 is not set in the message queue description associated with
74 blocks until space becomes available to enqueue the message, or until
76 is interrupted by a signal.
77 If more than one thread is waiting to send when space becomes available
78 in the message queue, then the thread of the highest priority that has
79 been waiting the longest will be unblocked to send its message.
80 If the specified message queue is full and
82 is set in the message queue description associated with
84 the message will not be queued and
90 function will add a message to the message queue specified by
92 in the manner defined for the
95 However, if the specified message queue is full and
97 is not set in the message queue description associated with
99 the wait for sufficient room in the queue will be terminated
100 when the specified timeout expires.
103 is set in the message queue description, this function will be equivalent to
106 The timeout will expire when the absolute time specified by
108 passes, as measured by the clock on which timeouts are based (that is,
109 when the value of that clock equals or exceeds
111 or if the absolute time specified by
113 has already been passed at the time of the call.
115 The resolution of the timeout is based on the CLOCK_REALTIME clock.
118 argument is defined in the
122 Under no circumstance will the operation fail with a timeout if there is
123 sufficient room in the queue to add the message immediately.
126 parameter need not be checked when there is sufficient room in the queue.
128 Upon successful completion, the
132 functions return a value of zero.
133 Otherwise, no message will be enqueued,
134 the functions will return \-1, and the global variable
136 will be set to indicate the error.
147 flag is set in the message queue description associated with
149 and the specified message queue is full.
153 argument is not a valid message queue descriptor open for writing.
155 A signal interrupted the call to
162 was outside the valid range, or
163 the process or thread would have blocked, and the
165 parameter specified a nanoseconds field value less than zero
166 or greater than or equal to 1000 million.
168 The specified message length,
170 exceeds the message size attribute of the message queue.
174 flag was not set when the message queue was opened,
175 but the timeout expired before the message could be added to the queue.
186 These functions are expected to conform to the
194 functions first appeared in
197 Portions of this text are reprinted and reproduced in electronic form
198 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
199 -- Portable Operating System Interface (POSIX), The Open Group Base
200 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
201 Electrical and Electronics Engineers, Inc and The Open Group.
203 event of any discrepancy between this version and the original IEEE and
204 The Open Group Standard, the original IEEE and The Open Group Standard
205 is the referee document.
206 The original Standard can be obtained online at
207 http://www.opengroup.org/unix/online.html .