diff --git a/man2/accept.2 b/man2/accept.2 index 51ab67f04..d396e09ac 100644 --- a/man2/accept.2 +++ b/man2/accept.2 @@ -39,7 +39,7 @@ .SH NAME accept \- accept a connection on a socket .SH SYNOPSIS -.B #include +.BR "#include " " /* See NOTES */" .br .B #include .sp @@ -255,6 +255,12 @@ of file status flags and always explicitly set all required flags on the socket returned from .BR accept (). .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + There may not always be a connection waiting after a .B SIGIO is delivered or diff --git a/man2/bind.2 b/man2/bind.2 index eec5c4940..792bd47b9 100644 --- a/man2/bind.2 +++ b/man2/bind.2 @@ -68,7 +68,7 @@ bind \- bind a name to a socket .SH SYNOPSIS .nf -.B #include +.BR "#include " " /* See NOTES */" .B #include .sp .BI "int bind(int " sockfd ", const struct sockaddr *" my_addr \ @@ -230,6 +230,12 @@ function first appeared in 4.2BSD). .\" .B EISDIR .\" Unix-domain error conditions. .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + The third argument of .BR bind () is in reality an diff --git a/man2/connect.2 b/man2/connect.2 index b500fa79e..e674ddd42 100644 --- a/man2/connect.2 +++ b/man2/connect.2 @@ -67,7 +67,7 @@ connect \- initiate a connection on a socket .SH SYNOPSIS .nf -.B #include +.BR "#include " " /* See NOTES */" .br .B #include .sp @@ -236,6 +236,12 @@ function first appeared in 4.2BSD), POSIX.1-2001. .\" It also .\" documents many additional error conditions not described here. .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + The third argument of .BR connect () is in reality an diff --git a/man2/gethostid.2 b/man2/gethostid.2 index f8ab6d8b5..475b8d7c0 100644 --- a/man2/gethostid.2 +++ b/man2/gethostid.2 @@ -68,6 +68,19 @@ POSIX.1-2001 specifies .BR gethostid () but not .BR sethostid (). +.SH NOTES +In the glibc implementation, if +.BR gethostid () +cannot open +.IR /etc/hostid , +then it obtains the host name using +.BR gethostname (2), +passes that host name to +.BR gethostbyaddr (3) +in order to obtain the host's IPv4 address, +and returns a value obtained by bit-twiddling the IPv4 address. +(This value may not be unique.) + .SH "SEE ALSO" .BR hostid (1), .BR gethostbyname (3) diff --git a/man2/getsockopt.2 b/man2/getsockopt.2 index cd5c5e9a7..17801caab 100644 --- a/man2/getsockopt.2 +++ b/man2/getsockopt.2 @@ -44,7 +44,7 @@ getsockopt, setsockopt \- get and set options on sockets .SH SYNOPSIS .nf -.B #include +.BR "#include " " /* See NOTES */" .br .B #include .sp @@ -171,6 +171,12 @@ POSIX.1-2001. .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO .\" options .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + The .I optlen argument of diff --git a/man2/listen.2 b/man2/listen.2 index 98c7174dd..891fce783 100644 --- a/man2/listen.2 +++ b/man2/listen.2 @@ -42,9 +42,13 @@ .SH NAME listen \- listen for connections on a socket .SH SYNOPSIS +.nf +.BR "#include " " /* See NOTES */" +.br .B #include .sp .BI "int listen(int " sockfd ", int " backlog ); +.fi .SH DESCRIPTION To accept connections, a socket is first created with .BR socket (2), @@ -100,6 +104,12 @@ The .BR listen () function call first appeared in 4.2BSD. .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + The behavior of the .I backlog parameter on TCP sockets changed with Linux 2.2. diff --git a/man2/socket.2 b/man2/socket.2 index 9043ce2bc..01de28f19 100644 --- a/man2/socket.2 +++ b/man2/socket.2 @@ -42,7 +42,7 @@ .SH NAME socket \- create an endpoint for communication .SH SYNOPSIS -.B #include +.BR "#include " " /* See NOTES */" .br .B #include .sp @@ -324,6 +324,12 @@ It is generally portable to/from non-BSD systems supporting clones of the BSD socket layer (including System V variants). .SH NOTES +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. + The manifest constants used under 4.x BSD for protocol families are PF_UNIX, PF_INET, etc., while AF_UNIX etc. are used for address families. diff --git a/man2/socketpair.2 b/man2/socketpair.2 index ef62a7b11..562aa6c5a 100644 --- a/man2/socketpair.2 +++ b/man2/socketpair.2 @@ -40,7 +40,7 @@ .SH NAME socketpair \- create a pair of connected sockets .SH SYNOPSIS -.B #include +.BR "#include " " /* See NOTES */" .br .B #include .sp @@ -100,6 +100,12 @@ On Linux, the only supported domain for this call is (or synonymously, .BR AF_LOCAL ). (Most implementations have the same restriction.) + +POSIX.1-2001 does not require the inclusion of +.IR , +and this header file is not required on Linux. +However, some historical (BSD) implementations required this header +file, and portable applications are probably wise to include it. .SH "SEE ALSO" .BR pipe (2), .BR read (2),