summaryrefslogtreecommitdiff
path: root/man2
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2005-06-30 09:31:55 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2005-06-30 09:31:55 +0000
commit0680fbb0e806ff9039f6cb87206acf4e1d5e70ab (patch)
tree2b8590f7d4d967c9db01c9dfb680671b883af5b6 /man2
parent0e5b601a02d714b3c1e92b43220d47638970cc5c (diff)
Various minor wording changes
Diffstat (limited to 'man2')
-rw-r--r--man2/socket.235
1 files changed, 16 insertions, 19 deletions
diff --git a/man2/socket.2 b/man2/socket.2
index 1aecd47d..f68c23cf 100644
--- a/man2/socket.2
+++ b/man2/socket.2
@@ -48,7 +48,7 @@ socket \- create an endpoint for communication
.sp
.BI "int socket(int " domain ", int " type ", int " protocol );
.SH DESCRIPTION
-.B Socket
+.BR socket ()
creates an endpoint for communication and returns a descriptor.
.PP
The
@@ -57,7 +57,6 @@ parameter specifies a communication domain; this selects the protocol
family which will be used for communication. These families are defined in
.BR <sys/socket.h> .
The currently understood formats include:
-.PP
.TS
tab(:);
l l l.
@@ -152,7 +151,7 @@ The
.I protocol
specifies a particular protocol to be used with the socket. Normally only
a single protocol exists to support a particular socket type within a given
-protocol family, in which a case
+protocol family, in which case
.I protocol
can be specified as 0.
However, it is possible that many protocols may exist, in
@@ -208,18 +207,19 @@ sockets employ the same system calls as
.B SOCK_STREAM
sockets. The only difference is that
.BR read (2)
-calls will return only the amount of data requested, and any remaining in
-the arriving packet will be discarded. Also all message boundaries in
-incoming datagrams are preserved.
+calls will return only the amount of data requested,
+and any data remaining in the arriving packet will be discarded.
+Also all message boundaries in incoming datagrams are preserved.
.PP
.B SOCK_DGRAM
and
.B SOCK_RAW
sockets allow sending of datagrams to correspondents named in
-.BR send (2)
-calls. Datagrams are generally received with
+.BR sendto (2)
+calls.
+Datagrams are generally received with
.BR recvfrom (2),
-which returns the next datagram with its return address.
+which returns the next datagram along with the address of its sender.
.PP
.B SOCK_PACKET
is an obsolete socket type to receive raw packets directly from the
@@ -229,19 +229,17 @@ instead.
.PP
An
.BR fcntl (2)
-call with the the
.B F_SETOWN
-argument
-can be used to specify a process group to receive a
+operation can be used to specify a process or process group to receive a
.B SIGURG
signal when the out-of-band data arrives or
.B SIGPIPE
signal when a
.B SOCK_STREAM
connection breaks unexpectedly.
-It may also be used to set the process or process group that receives
-the I/O and asynchronous notification of I/O events via
-.BR SIGIO.
+This operation may also be used to set the process or process group
+that receives the I/O and asynchronous notification of I/O events via
+.BR SIGIO .
Using
.B F_SETOWN
is equivalent to an
@@ -252,7 +250,7 @@ or
.B SIOCSPGRP
argument.
.PP
-When the network signals an error condition to the protocol module (e.g.
+When the network signals an error condition to the protocol module (e.g.,
using a ICMP message for IP) the pending error flag is set for the socket.
The next operation on this socket will return the error code of the pending
error. For some protocols it is possible to enable a per-socket error queue
@@ -304,9 +302,8 @@ supported within this domain.
Other errors may be generated by the underlying protocol modules.
.SH "CONFORMING TO"
4.4BSD, SUSv2, POSIX 1003.1-2001.
-The
-.B socket
-function call appeared in 4.2BSD. It is generally portable to/from
+.BR socket ()
+appeared in 4.2BSD. It is generally portable to/from
non-BSD systems supporting clones of the BSD socket layer (including
System V variants).
.SH NOTE