Subject: lib/9727: connect() manual page should mention getsockopt()
To: None <netbsd-bugs@netbsd.org>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: netbsd-bugs
Date: 04/05/2000 14:58:19
Date: 15 Aug 1999 01:32:59 -0000
From: dave@dtsp.co.nz
Reply-To: dave@dtsp.co.nz
To: gnats-bugs@gnats.netbsd.org
Cc: dave@dtsp.co.nz
Subject: connect() manual page should mention getsockopt()


>Number:         9727
>Category:       lib
>Synopsis:       connect() manual page should mention getsockopt()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 31 00:16:38 PST 2000
>Closed-Date:    
>Last-Modified:  
>Originator:     Dave Sainty
>Release:        current 19990814
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Environment:
>Description:
	The manual page doesn't give enough detail on how to complete a
	non-blocking connect.
>How-To-Repeat:
	man connect
>Fix:
Easy!  Apply this patch!


--- lib/libc/sys/connect.2.orig Sun Aug 15 13:07:20 1999
+++ lib/libc/sys/connect.2      Sun Aug 15 13:29:18 1999
@@ -113,7 +113,15 @@
 .Xr select 2
 or
 .Xr poll 2
-for completion by selecting or polling the socket for writing.
+for completion by selecting or polling the socket for writing.  The success or
+failure of the connect operation may be determined by using
+.Xr getsockopt 2
+to read the socket error status with the
+.Dv SO_ERROR
+option at the
+.Dv SOL_SOCKET
+level.  The returned socket error status is zero on success, or one of the
+error codes listed here on failure.
 .It Bq Er EALREADY
 The socket is non-blocking
 and a previous connection attempt
@@ -149,7 +157,8 @@
 .Xr poll 2 ,
 .Xr select 2 ,
 .Xr socket 2 ,
-.Xr getsockname 2
+.Xr getsockname 2 ,
+.Xr getsockopt 2
 .Sh HISTORY
 The
 .Fn connect
>Release-Note:
>Audit-Trail:
>Unformatted:
 System: NetBSD tequila.dave.dtsp.co.nz 1.4J NetBSD 1.4J (TEQUILA) #3: Wed Aug 11 21:35:56 NZST 1999 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userB/u2/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386