]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/connect.2
user_namespaces.7: Minor wording fix to recently added text
[thirdparty/man-pages.git] / man2 / connect.2
index c6cedcd76706f9ac891a82bd9346a9eafa8499d8..679b0fec5035773f11b1f529c03205a09d2f087a 100644 (file)
@@ -64,7 +64,7 @@
 .\" Modified 1998, 1999 by Andi Kleen
 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
-.TH CONNECT 2 2016-12-12 "Linux" "Linux Programmer's Manual"
+.TH CONNECT 2 2019-03-06 "Linux" "Linux Programmer's Manual"
 .SH NAME
 connect \- initiate a connection on a socket
 .SH SYNOPSIS
@@ -72,7 +72,7 @@ connect \- initiate a connection on a socket
 .BR "#include <sys/types.h>" "          /* See NOTES */"
 .br
 .B #include <sys/socket.h>
-.sp
+.PP
 .BI "int connect(int " sockfd ", const struct sockaddr *" addr ,
 .BI "            socklen_t " addrlen );
 .fi
@@ -94,7 +94,7 @@ is determined by the address space of the socket
 see
 .BR socket (2)
 for further details.
-
+.PP
 If the socket
 .I sockfd
 is of type
@@ -168,7 +168,9 @@ The passed address didn't have the correct address family in its
 field.
 .TP
 .B EAGAIN
-Insufficient entries in the routing cache.
+For nonblocking UNIX domain sockets, the socket is nonblocking, and the
+connection cannot be completed immediately.
+For other socket families, there are insufficient entries in the routing cache.
 .TP
 .B EALREADY
 The socket is nonblocking and a previous connection attempt has not yet
@@ -179,14 +181,18 @@ been completed.
 is not a valid open file descriptor.
 .TP
 .B ECONNREFUSED
-No-one listening on the remote address.
+A
+.BR connect ()
+on a stream socket found no one listening on the remote address.
 .TP
 .B EFAULT
 The socket structure address is outside the user's address space.
 .TP
 .B EINPROGRESS
-The socket is nonblocking and the connection cannot be completed
-immediately.
+The socket is nonblocking and the connection cannot be completed immediately.
+(UNIX domain sockets failed with
+.BR EAGAIN
+instead.)
 It is possible to
 .BR select (2)
 or
@@ -238,9 +244,9 @@ busy to accept new connections.
 Note that for IP sockets the timeout may
 be very long when syncookies are enabled on the server.
 .SH CONFORMING TO
-POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD, (the
-.BR connect ()
-function first appeared in 4.2BSD).
+POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD,
+.RB (connect ()
+first appeared in 4.2BSD).
 .\" SVr4 documents the additional
 .\" general error codes
 .\" .BR EADDRNOTAVAIL ,
@@ -259,12 +265,12 @@ POSIX.1 does not require the inclusion of
 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.
-
+.PP
 For background on the
 .I socklen_t
 type, see
 .BR accept (2).
-
+.PP
 If
 .BR connect ()
 fails, consider the state of the socket as unspecified.