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

  man pages->IRIX man pages -> mq_receive (3c)              
Title
Content
Arch
Section
 

Contents


mq_receive(3c)							mq_receive(3c)


NAME    [Toc]    [Back]

     mq_receive	- receive a message from a queue

C SYNOPSIS    [Toc]    [Back]

     #include <mqueue.h>

     int mq_receive (mqd_t mqd<b>,	char *msgptr<b>, size_t msglen<b>, unsigned int
     *msgprio<b>);

DESCRIPTION    [Toc]    [Back]

     mq_receive	removes	a message, of size msglen bytes, from the message
     queue named by the	mqd descriptor,	and copies it to the buffer at address
     msgptr.

     Messages are removed in priority order with higher	priority messages
     removed before the	lower priority messages. The larger the	numerical
     value of the priority, the	more important the message.  If	the argument
     msgprio is	not NULL, the priority of the message removed is stored	at
     address msgprio.  Messages	of equal priority are removed in FIFO order.

     If	the O_NONBLOCK flag is set for the mdq message queue descriptor,
     mq_receive	will not block when the	queue is empty [see mq_setattr(3c)].
     Otherwise,	mq_receive will	block until either a message is	present	in the
     queue, or mq_receive is interrupted by a signal.

     If	multiple processes are waiting to receive a message from the queue,
     the highest priority process will receive the message when	it is
     delivered.	 Processes with	equal priorities, blocked waiting for
     messages, are unblocked in	FIFO order when	messages arrive.

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

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

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

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

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

SEE ALSO    [Toc]    [Back]

      
      
     mq_open(3c), intro(3c), mq_unlink(3c), mq_send(3c), mq_getattr(3c),
     mq_notify(3c)

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, mq_receive returns the	number of bytes	in the
     message received, with the	message	copied to the buffer pointed to	by
     msgptr and	the priority of	the message stored in the location pointed to
     by	msgprio.  Otherwise, no	message	is removed from	the queue and a	value



									Page 1






mq_receive(3c)							mq_receive(3c)



     of	-1 is returned and errno is set	to indicate the	error.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
msgrcv Tru64 Receive a message from a message queue
msgrcv NetBSD receive a message from a message queue
mq_receive HP-UX receive a message from a message queue
msgrcv OpenBSD receive a message from a message queue
msgrcv FreeBSD receive a message from a message queue
mq_open Tru64 Establishes the connection between a message queue and a message queue descriptor (P1003.1b)
alSelectEvents IRIX Setup event queue to receive audio events.
recvmsg Tru64 Receive a message from a socket using a message structure
mq_receive Tru64 Receives the oldest, highest-priority message from the message queue (P1003.1b)
tt_message_receive HP-UX receive a message
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service