-.\" $OpenBSD: connect.2,v 1.28 2016/08/09 12:06:58 millert Exp $
+.\" $OpenBSD: connect.2,v 1.29 2016/08/09 17:34:06 millert Exp $
.\" $NetBSD: connect.2,v 1.8 1995/10/12 15:40:48 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
multiple times to change their association.
Datagram sockets may dissolve the association
by connecting to an invalid address, such as a null address.
+.Pp
+If the socket is in non-blocking mode and the connection cannot be
+completed immediately, or if it is interrupted by a signal,
+.Fn connect
+will return an error and the connection attempt will proceed
+asynchronously.
+Subsequent calls to
+.Fn connect
+will fail with errno set to
+.Er EALREADY .
+It is possible to use
+.Xr select 2
+or
+.Xr poll 2
+to determine when the connect operation has completed by checking the
+socket for writability.
+The success or failure of the connection attempt may be determined by using
+.Xr getsockopt 2
+to check the socket error status with the
+.Dv SO_ERROR
+option at the
+.Dv SOL_SOCKET
+level.
+If the connection was successful, the error value will be zero.
+Otherwise, it will be one of the error values listed below.
.Sh RETURN VALUES
If the connection or binding succeeds, 0 is returned.
Otherwise a \-1 is returned, and a more specific error
.It Bq Er EHOSTUNREACH
The destination address specified an unreachable host.
.It Bq Er EINTR
-Connection establishment was interrupted by the delivery of a signal.
+The connection attempt was interrupted by a signal.
The attempt will continue asynchronously as if the socket was non-blocking.
.It Bq Er ENETUNREACH
The network isn't reachable from this host.
parameter specifies an area outside
the process address space.
.It Bq Er EINPROGRESS
-The socket is non-blocking
-and the connection cannot
+The socket is non-blocking and the connection cannot
be completed immediately.
-It is possible to
-.Xr select 2
-or
-.Xr poll 2
-for completion by selecting the socket for writing, and also use
-.Xr getsockopt 2
-with
-.Dv SO_ERROR
-to check for error conditions.
.It Bq Er EALREADY
-A previous connection attempt has not yet been completed.
+Either the socket is non-blocking or a previous call to
+.Fn connect
+was interrupted by a signal, and the connection attempt has not yet
+been completed.
.El
.Pp
The following errors are specific to connecting names in the