*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> mq_send (3c)              


mq_send(3c)							   mq_send(3c)

NAME    [Toc]    [Back]

     mq_send - send a message to a queue

C SYNOPSIS    [Toc]    [Back]

     #include <mqueue.h>

     int mq_send (mqd_t	mqd<b>, const char	*msgptr<b>, size_t	msglen<b>,	unsigned int

DESCRIPTION    [Toc]    [Back]

     mq_send sends the message at address msgptr, of size msglen bytes,	to the
     message queue named by mqd.

     The message is queued in priority order, as specified by msgprio.	The
     larger the	numerical value	of the priority, the more important the
     message. Messages with same priorities are	queued in FIFO order.  The
     value of msgprio must be less than	{MQ_PRIO_MAX}.

     A message queue is	full when the number of	the messages queued equals the
     value the of mq_maxmsg attribute of the queue. If the O_NONBLOCK flag is
     set for the message queue descriptor mqd, mq_send will not	block when the
     queue is full [see	mq_setattr(3c)].  Otherwise, mq_send will block	until
     either space becomes available to queue the message, or mq_send is
     interrupted by a signal.

     If	multiple processes are waiting to send a message to the	queue, the
     highest priority process will be unblocked	to queue its message when
     space becomes available. Processes	with equal priorities, blocked waiting
     to	queue a	message, are unblocked in FIFO order when queue	space becomes

     mq_send will fail if one or more of the following conditions are true:

     [EAGAIN]	    The	O_NONBLOCK flag	is set for the queue descriptor	and
		    the	queue is full.

     [EBADF]	    The	message	queue descriptor, mqd, is not valid or the
		    queue was not opened for writing.

     [EINTR]	    The	mq_send	system call was	interrupted by a signal.

     [EINVAL]	    The	value of msgprio is not	less than {MQ_PRIO_MAX}.

     [EMSGSIZE]	    The	size of	the message, msglen, is	greater	than the value
		    of the mq_maxsize attribute	of the queue.

SEE ALSO    [Toc]    [Back]

     mq_open(3c), intro(3c), mq_unlink(3c), mq_receive(3c), mq_getattr(3c),

									Page 1

mq_send(3c)							   mq_send(3c)

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, a value of 0 is returned and the message is
     added to the queue.  Otherwise, the message is not	added to the queue, a
     value of -1 is returned and errno is set to indicate the error.

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
msgsnd NetBSD send a message to a message queue
msgsnd OpenBSD send a message to a message queue
mq_send HP-UX send a message to a message queue
msgsnd FreeBSD send a message to a message queue
msgsnd Tru64 Send a message to a message queue
mq_open Tru64 Establishes the connection between a message queue and a message queue descriptor (P1003.1b)
mq_receive Tru64 Receives the oldest, highest-priority message from the message queue (P1003.1b)
mq_send Tru64 Places a message in the message queue (P1003.1b)
send Tru64 send a message (only available within the message handling system, mh)
sendmsg Tru64 Send a message from a socket using a message structure
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service