


     msgrcv(XPG4.os/ipcRelease 4.4.1 (The Open Groumsgrcv(XPG4.os/ipc)



     NAME
	  XPG4.os/ipc/msgrcv - receive message from message queue.

     DESCRIPTION
	  Msgrcv tests the msgrcv() subroutine call interface for
	  conformance to the XSI System	Interfaces Page:msgrcv()

     TESTS
     Compliance
	  1    When msgtp is equal to zero and messages	are available
	       for msqid then a	successful call	to msgrcv(msqid, msgp,
	       msgsz, msgtp, msgflg) retrieves the first message from
	       the queue, msqid, and returns the number	of bytes
	       placed in the mtext member of the message structure,
	       msgp. The mtype member of the message structure is set
	       to the type of the received message.

	  2    When msgtp is greater than zero and messages of the
	       same type are available for msqid then a	successful
	       call to msgrcv(msqid, msgp, msgsz, msgtp, msgflg)
	       retrieves the first message of this type	from the queue
	       msqid, and returns the number of	bytes placed in	the
	       mtext member of the message structure msgp. The mtype
	       member of the message structure is set to the type of
	       the received message.

	  3    When msgtp is less than zero and	messages with type
	       less than or equal to the absolute value	of msgtp are
	       available for msqid, then a successful call to
	       msgrcv(msqid, msgp, msgsz, msgtp, msgflg) retrieves the
	       first such message of the lowest	type from the queue
	       and returns the number of bytes placed in the mtext
	       member of the message structure msgp. The mtype member
	       of the message structure	is set to the type of the
	       received	message.

	  4    When the	IPC_NOWAIT bit is clear	in msgflg and there
	       are no messages of the requested	type in	the message
	       queue msqid, then a call	to msgrcv(msqid, msgp, msgsz,
	       msgtp, msgflg) suspends execution of the	calling
	       process.

	  5    When the	calling	process	is suspended and a message of
	       the desired type	is placed on the queue,	then a call to
	       msgrcv(msqid, msgp, msgsz, msgtp, msgflg) retrieves the
	       message and returns the number of bytes placed in the
	       mtext field of the message structure.  When a message
	       is retrieved from a call	to msgrcv(msqid, msgp, msgsz,
	       msgtp, msgflg) then it is read into the message buffer
	       pointed to by msgp, msg_qnum is decremented by 1,
	       msg_lrpid is set	to the calling process's ID, and
	       msg_rtime is set	to the current time.



     Page 1					    (printed 2/21/103)






     msgrcv(XPG4.os/ipcRelease 4.4.1 (The Open Groumsgrcv(XPG4.os/ipc)



	  6    When a message with size	larger than msgsz is retrieved
	       from a call to msgrcv(msqid, msgp, msgsz, msgtp,
	       msgflg) and the MSG_NOERROR flag	is set in msgflg, then
	       the retrieved message is	truncated to msgsz.

     Deviance
	  7    ENOMSG in errno and return -1 on	a call to
	       msgrcv(msqid, msgp, msgsz, msgtp, msgflg) when the
	       IPC_NOWAIT bit is set in	msgflg and there are no
	       messages	of the requested type in the message queue
	       msqid.

	  8    EIDRM in	errno and return -1 on a call to msgrcv(msqid,
	       msgp, msgsz, msgtp, msgflg) when	the calling process is
	       suspended and the message queue msqid is	removed.

	  9    EINTR in	errno and return -1 on a call to msgrcv(msqid,
	       msgp, msgsz, msgtp, msgflg) when	the calling process is
	       suspended and a signal is received.

	  10   EINVAL in errno and return -1 on	a call to
	       msgrcv(msqid, msgp, msgsz, msgtp, msgflg) when msqid is
	       not a valid message queue identifier.

	  11   Not in use.

	  12   EACCES in errno and return -1 on	a call to
	       msgrcv(msqid, msgp, msgsz, msgtp, msgflg) when an
	       attempt is made to read a message and the calling
	       process does not	have read permission for the message
	       queue.

	  13   E2BIG in	errno and return -1 on a call to msgrcv(msqid,
	       msgp, msgsz, msgtp, msgflg) when	the MSG_NOERROR	bit is
	       clear in	msgflg and the message to be read is longer
	       than the	value specified	in msgsz.

     RELEASE
	  4.4.1	(06/09/97)
	  Copyright 1997, The Open Group
	  All Rights Reserved














     Page 2					    (printed 2/21/103)



