update, describe rights, add errnos
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 15 May 1986 02:11:46 +0000 (18:11 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 15 May 1986 02:11:46 +0000 (18:11 -0800)
SCCS-vsn: lib/libc/sys/send.2 6.3
SCCS-vsn: lib/libc/sys/recv.2 6.2

usr/src/lib/libc/sys/recv.2
usr/src/lib/libc/sys/send.2

index 0d5787f..3ffc43d 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)recv.2      6.1 (Berkeley) %G%
+.\"    @(#)recv.2      6.2 (Berkeley) %G%
 .\"
 .TH RECV 2 ""
 .UC 5
 .\"
 .TH RECV 2 ""
 .UC 5
@@ -43,7 +43,7 @@ are used to receive messages from a socket.
 .PP
 The 
 .I recv
 .PP
 The 
 .I recv
-call may be used only on a 
+call is normally used only on a 
 .I connected
 socket (see
 .IR connect (2)),
 .I connected
 socket (see
 .IR connect (2)),
@@ -85,13 +85,13 @@ call may be used to determine when more data arrives.
 .PP
 The
 .I flags
 .PP
 The
 .I flags
-argument to a send call is formed by 
+argument to a recv call is formed by 
 .IR or 'ing
 one or more of the values,
 .PP
 .nf
 .RS
 .IR or 'ing
 one or more of the values,
 .PP
 .nf
 .RS
-.DT
+.ta \w'#define\ \ 'u +\w'MSG_DONTROUTE\ \ \ 'u +\w'0x\0\0\0\ \ 'u
 #define        MSG_OOB 0x1     /* process out-of-band data */
 #define        MSG_PEEK        0x2     /* peek at incoming message */
 .RE
 #define        MSG_OOB 0x1     /* process out-of-band data */
 #define        MSG_PEEK        0x2     /* peek at incoming message */
 .RE
@@ -132,11 +132,14 @@ and
 .I msg_iovlen
 describe the scatter gather locations, as described in
 .IR read (2).
 .I msg_iovlen
 describe the scatter gather locations, as described in
 .IR read (2).
-Access rights to be sent along with the message are specified
+A buffer to receive any access rights sent along with the message is specified
 in 
 .IR msg_accrights ,
 which has length
 .IR msg_accrightslen .
 in 
 .IR msg_accrights ,
 which has length
 .IR msg_accrightslen .
+Access rights are currently limited to file descriptors,
+which each occupy the size of an
+.BR int .
 .SH "RETURN VALUE
 These calls return the number of bytes received, or \-1
 if an error occurred.
 .SH "RETURN VALUE
 These calls return the number of bytes received, or \-1
 if an error occurred.
@@ -161,4 +164,4 @@ any data was available for the receive.
 The data was specified to be received into a non-existent
 or protected part of the process address space.
 .SH SEE ALSO
 The data was specified to be received into a non-existent
 or protected part of the process address space.
 .SH SEE ALSO
-read(2), send(2), socket(2)
+fcntl(2), read(2), send(2), select(2), getsockopt(2), socket(2)
index e61f1c3..96b731b 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)send.2      6.2 (Berkeley) %G%
+.\"    @(#)send.2      6.3 (Berkeley) %G%
 .\"
 .TH SEND 2 ""
 .UC 5
 .\"
 .TH SEND 2 ""
 .UC 5
@@ -68,7 +68,7 @@ If no messages space is available at the socket to hold
 the message to be transmitted, then
 .I send
 normally blocks, unless the socket has been placed in
 the message to be transmitted, then
 .I send
 normally blocks, unless the socket has been placed in
-non-blocking i/o mode.
+non-blocking I/O mode.
 The
 .IR select (2)
 call may be used to determine when it is possible to
 The
 .IR select (2)
 call may be used to determine when it is possible to
@@ -76,8 +76,19 @@ send more data.
 .PP
 The
 .I flags
 .PP
 The
 .I flags
-parameter may be set to MSG_OOB to send \*(lqout-of-band\*(rq
-data on sockets that support this notion (e.g. SOCK_STREAM).
+parameter may include one or more of the following:
+.PP
+.nf
+.RS
+.ta \w'#define\ \ 'u +\w'MSG_DONTROUTE\ \ \ 'u +\w'0x\0\0\0\ \ 'u
+#define        MSG_OOB 0x1     /* process out-of-band data */
+#define        MSG_DONTROUTE   0x4     /* bypass routing, use direct interface */
+.RE
+.fi
+The flag MSG_OOB is used to send \*(lqout-of-band\*(rq
+data on sockets that support this notion (e.g. SOCK_STREAM);
+the underlying protocol must also support \*(lqout-of-band\*(rq data.
+MSG_DONTROUTE is usually used only by diagnostic or routing programs.
 .PP
 See 
 .IR recv (2)
 .PP
 See 
 .IR recv (2)
@@ -105,5 +116,14 @@ and the size of the message to be sent made this impossible.
 [EWOULDBLOCK]
 The socket is marked non-blocking and the requested operation
 would block.
 [EWOULDBLOCK]
 The socket is marked non-blocking and the requested operation
 would block.
+.TP 20
+[ENOBUFS]
+The system was unable to allocate an internal buffer.
+The operation may succeed when buffers become available.
+.TP 20
+[ENOBUFS]
+The output queue for a network interface was full.
+This generally indicates that the interface has stopped sending,
+but may be caused by transient congestion.
 .SH SEE ALSO
 .SH SEE ALSO
-recv(2), socket(2)
+fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2)