msgrcv.2 (108030) | msgrcv.2 (108087) |
---|---|
1.\" $NetBSD: msgrcv.2,v 1.1 1995/10/16 23:49:20 jtc Exp $ 2.\" 3.\" Copyright (c) 1995 Frank van der Linden 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 14 unchanged lines hidden (view full) --- 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 1.\" $NetBSD: msgrcv.2,v 1.1 1995/10/16 23:49:20 jtc Exp $ 2.\" 3.\" Copyright (c) 1995 Frank van der Linden 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 14 unchanged lines hidden (view full) --- 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31.\" $FreeBSD: head/lib/libc/gen/msgrcv.3 108030 2002-12-18 10:13:54Z ru $ | 31.\" $FreeBSD: head/lib/libc/gen/msgrcv.3 108087 2002-12-19 09:40:28Z ru $ |
32.\" 33.\"/ 34.Dd November 24, 1997 35.Dt MSGRCV 3 36.Os 37.Sh NAME 38.Nm msgrcv 39.Nd receive a message from a message queue --- 24 unchanged lines hidden (view full) --- 64is an array of bytes, with a size up to that of the system limit 65.Pf ( Dv MSGMAX ) . 66.Pp 67The value of 68.Fa msgtyp 69has one of the following meanings: 70.Bl -bullet 71.It | 32.\" 33.\"/ 34.Dd November 24, 1997 35.Dt MSGRCV 3 36.Os 37.Sh NAME 38.Nm msgrcv 39.Nd receive a message from a message queue --- 24 unchanged lines hidden (view full) --- 64is an array of bytes, with a size up to that of the system limit 65.Pf ( Dv MSGMAX ) . 66.Pp 67The value of 68.Fa msgtyp 69has one of the following meanings: 70.Bl -bullet 71.It |
72The |
|
72.Fa msgtyp | 73.Fa msgtyp |
74argument |
|
73is greater than 0. The first message of type 74.Fa msgtyp 75will be received. 76.It | 75is greater than 0. The first message of type 76.Fa msgtyp 77will be received. 78.It |
79The |
|
77.Fa msgtyp | 80.Fa msgtyp |
81argument |
|
78is equal to 0. The first message on the queue will be received. 79.It | 82is equal to 0. The first message on the queue will be received. 83.It |
84The |
|
80.Fa msgtyp | 85.Fa msgtyp |
86argument |
|
81is less than 0. The first message of the lowest message type that is 82less than or equal to the absolute value of 83.Fa msgtyp 84will be received. 85.El 86.Pp | 87is less than 0. The first message of the lowest message type that is 88less than or equal to the absolute value of 89.Fa msgtyp 90will be received. 91.El 92.Pp |
93The |
|
87.Fa msgsz | 94.Fa msgsz |
95argument |
|
88specifies the maximum length of the requested message. 89If the received 90message has a length greater than 91.Fa msgsz 92it will be silently truncated if the 93.Dv MSG_NOERROR 94flag is set in 95.Fa msgflg , --- 64 unchanged lines hidden (view full) --- 160set to indicate the error. 161.Sh ERRORS 162The 163.Fn msgrcv 164function 165will fail if: 166.Bl -tag -width Er 167.It Bq Er EINVAL | 96specifies the maximum length of the requested message. 97If the received 98message has a length greater than 99.Fa msgsz 100it will be silently truncated if the 101.Dv MSG_NOERROR 102flag is set in 103.Fa msgflg , --- 64 unchanged lines hidden (view full) --- 168set to indicate the error. 169.Sh ERRORS 170The 171.Fn msgrcv 172function 173will fail if: 174.Bl -tag -width Er 175.It Bq Er EINVAL |
176The |
|
168.Fa msqid | 177.Fa msqid |
178argument |
|
169is not a valid message queue identifier. 170.Pp 171The message queue was removed while 172.Fn msgrcv 173was waiting for a message of the requested type to become available on it. 174.Pp | 179is not a valid message queue identifier. 180.Pp 181The message queue was removed while 182.Fn msgrcv 183was waiting for a message of the requested type to become available on it. 184.Pp |
185The |
|
175.Fa msgsz | 186.Fa msgsz |
187argument |
|
176is less than 0. 177.It Bq Er E2BIG 178A matching message was received, but its size was greater than 179.Fa msgsz 180and the 181.Dv MSG_NOERROR 182flag was not set in 183.Fa msgflg . 184.It Bq Er EACCES 185The calling process does not have read access to the message queue. 186.It Bq Er EFAULT | 188is less than 0. 189.It Bq Er E2BIG 190A matching message was received, but its size was greater than 191.Fa msgsz 192and the 193.Dv MSG_NOERROR 194flag was not set in 195.Fa msgflg . 196.It Bq Er EACCES 197The calling process does not have read access to the message queue. 198.It Bq Er EFAULT |
199The |
|
187.Fa msgp | 200.Fa msgp |
201argument |
|
188points to an invalid address. 189.It Bq Er EINTR 190The system call was interrupted by the delivery of a signal. 191.It Bq Er EAGAIN 192There is no message of the requested type available on the message queue, 193and 194.Dv IPC_NOWAIT 195is set in 196.Fa msgflg . 197.El 198.Sh SEE ALSO 199.Xr msgctl 3 , 200.Xr msgget 3 , 201.Xr msgsnd 3 202.Sh HISTORY 203Message queues appeared in the first release of 204.At V . | 202points to an invalid address. 203.It Bq Er EINTR 204The system call was interrupted by the delivery of a signal. 205.It Bq Er EAGAIN 206There is no message of the requested type available on the message queue, 207and 208.Dv IPC_NOWAIT 209is set in 210.Fa msgflg . 211.El 212.Sh SEE ALSO 213.Xr msgctl 3 , 214.Xr msgget 3 , 215.Xr msgsnd 3 216.Sh HISTORY 217Message queues appeared in the first release of 218.At V . |