Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mq_send(3) [osf1 man page]

mq_send(3)						     Library Functions Manual							mq_send(3)

NAME
mq_send - Places a message in the message queue (P1003.1b) LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <mqueue.h> int mq_send ( mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio); PARAMETERS
mqdes Specifies a message queue descriptor. *msg_ptr Specifies a pointer to a buffer containing the message to be sent. msg_len Indicates the number of bytes of the message to be sent. msg_prio Indicates the priority of the message being sent. DESCRIPTION
The mq_send function places a message in the message queue. This function inserts the message in the queue at the position indicated by the msg_prio argument. A message with a relatively large numeric value for the msg_prio argument has a high priority, and it is therefore inserted before messages with lower values for the msg_prio argument. This function inserts messages with equal priority into the queue in first-in/first-out order. Thus the function inserts a message with a given priority after already-queued messages that have the same pri- ority. If the message queue is full, and the O_NONBLOCK flag associated with it is not set, the mq_send function blocks until sufficient space in the message queue becomes available or until a signal interrupts the mq_send function. If two or more processes are waiting to send messages when space becomes available in the queue, the highest-priority process that has been waiting the longest sends the message first. The mq_send function returns an error if the specified queue is full and the O_NONBLOCK flag is set for that queue. RETURN VALUES
On successful completion, the mq_send function returns a value of 0 (zero). Otherwise, no message is sent, -1 is returned, and errno is set to indicate the error. ERRORS
The mq_send function fails under the following conditions: [EAGAIN] The O_NONBLOCK flag is set in the message queue description associated with mqdes, and the specified message queue is full. [EBADF] The mqdes argument is not a valid message queue descriptor open for writing. [EFAULT] An internal virtual memory error occurred. [EINTR] A signal interrupted the call to mq_send. [EINVAL] The value of msg_prio is outside the valid range. [EMSGSIZE] The specified message length, msg_len, exceeds the message size attribute of the message queue. Note that a zero-length message is valid. RELATED INFORMATION
Functions: mq_receive(3), mq_setattr(3) Guide to Realtime Programming delim off mq_send(3)

Check Out this Related Man Page

mq_send(2)							System Calls Manual							mq_send(2)

NAME
mq_send - send a message to a message queue SYNOPSIS
DESCRIPTION
The system call adds a message pointed to by the argument msg_ptr to the message queue specified by mqdes. The msg_len argument specifies the length of the message in bytes. The value of msg_len should be less than or equal to the mq_msgsize attribute of the message queue, or will fail. If the specified message queue is not full, will insert the message into the queue at the position indicated by the msg_prio argument. A message with priority, msg_prio, will be inserted behind any other messages with larger or equal priority. The value of msg_prio should be less than If the specified message queue is full and the flag is not set in the message queue blocking status associated with mqdes, will block in priority order, until it can send a message on the queue, or until is interrupted by a signal. If the specified message queue is full and the flag is set in the message queue blocking status associated with mqdes, the message will not be enqueued, and will return with an error. To use this function, link in the realtime library by specifying on the compiler or linker command line. RETURN VALUE
returns the following values: Successful completion. The message is enqueued. Failure. is set to indicate the error and the message is not enqueued. ERRORS
If fails, is set to one of the following values: [EAGAIN] The flag is set in the message queue blocking status associated with mqdes, and the message queue is full. [EBADF] mqdes is not a valid message queue descriptor open for writing. [EINTR] A signal interrupted the call to [EINVAL] msg_ptr points to an invalid address, or the value of msg_prio is outside the valid range. [EMSGSIZE] The specified message length, msg_len, exceeds the message size attribute of the message queue. [ENOSYS] is not supported by the implementation. SEE ALSO
mq_receive(2), mq_setattr(2), mq_getattr(2), sysconf(2). STANDARDS CONFORMANCE
mq_send(2)
Man Page