Subject: lib/8208: connect() manual page should mention getsockopt()
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 08/15/1999 05:52:55
>Number:         8208
>Category:       lib
>Synopsis:       connect() manual page should mention getsockopt()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 15 05:35:00 1999
>Last-Modified:
>Originator:     Dave Sainty
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Release:        current 19990814
>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
>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