.\" Language and formatting clean-ups
.\" Added notes on /proc files
.\"
-.TH MSGOP 2 2006-02-02 "Linux" "Linux Programmer's Manual"
+.TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual"
.SH NAME
msgop, msgrcv, msgsnd \- message operations
.SH SYNOPSIS
(see the description of
.BR msgrcv ()
below).
-.PP
+.SS msgsnd()
The
.BR msgsnd ()
system call appends a copy of the message pointed to by
A blocked
.BR msgsnd ()
-call may also fail if the queue is removed
-(in which case the system call fails with
+call may also fail if:
+.IP * 2
+the queue is removed,
+in which case the system call fails with
.I errno
set to
-.BR EIDRM ),
-or a signal is caught (in which case the system call fails
+.BR EIDRM ;
+or
+.IP *
+a signal is caught, in which case the system call fails
with
.I errno
set to
-.BR EINTR ).
-.RB ( msgsnd " and " msgrcv
-are never automatically restarted after being interrupted by a
+.BR EINTR .
+.RB ( msgsnd ()
+is never automatically restarted after being interrupted by a
signal handler, regardless of the setting of the
.B SA_RESTART
flag when establishing a signal handler.)
.IP
.I msg_stime
is set to the current time.
-.PP
-The system call
+.SS msgrcv()
+The
.BR msgrcv ()
-removes a message from the queue specified by
+system call removes a message from the queue specified by
.I msqid
and places it in the buffer
pointed to by
The argument
.I msgtyp
specifies the type of message requested as follows:
-.IP
+.IP * 2
If
.I msgtyp
is 0,
then the first message in the queue is read.
-.IP
+.IP *
If
.I msgtyp
is greater than 0,
the first message in the queue of type not equal to
.I msgtyp
will be read.
-.IP
+.IP *
If
.I msgtyp
is less than 0,
isn't specified in
.IR msgflg ,
the calling process is blocked until one of the following conditions occurs:
-.IP
+.IP * 2
A message of the desired type is placed in the queue.
-.IP
+.IP *
The message queue is removed from the system.
In this case the system call fails with
.I errno
set to
.BR EIDRM .
-.IP
+.IP *
The calling process catches a signal.
In this case the system call fails with
.I errno
set to
.BR EINTR .
+.RB ( msgrcv ()
+is never automatically restarted after being interrupted by a
+signal handler, regardless of the setting of the
+.B SA_RESTART
+flag when establishing a signal handler.)
.PP
Upon successful completion the message queue data structure is updated
as follows: