Subject: lib/17921: man getsockname(2) does not mention EINVAL
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ChristianBiere@gmx.de>
List: netbsd-bugs
Date: 08/12/2002 18:05:55
>Number: 17921
>Category: lib
>Synopsis: man getsockname(2) does not mention EINVAL
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 12 18:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Christian Biere
>Release: NetBSD 1.6_BETA4
>Organization:
>Environment:
>Description:
getsockname() returns EINVAL sometimes. I've read in other man pages this means "The socket has been shut down.". I haven't verified whether this is
true for NetBSD, so someone should have a look at the sources.
>How-To-Repeat:
This can happen with non-blocking sockets when connect() returned EINPROGRESS. This is the relevant output from ktruss:
socket(0x2, 0x1, 0) = 9
fcntl(0x9, 0x3, 0) = 2
fcntl(0x9, 0x4, 0x6) = 0
fcntl(0x9, 0x3, 0) = 6
connect(0x9, 0x80d5c98, 0x10) Err#36 EINPROGRESS
fcntl(0x9, 0x3, 0) = 6
select(0xa, 0, 0x80d5bb8, 0, 0x80d5b88) = 0
fcntl(0x9, 0x3, 0) = 6
fcntl(0x9, 0x4, 0x2) = 0
select(0xa, 0x80d5bc8, 0, 0, 0x80d5b78) = 1
getsockname(0x9, 0x80d5c98, 0x80d5c94) Err#22 EINVAL
>Fix:
--- /usr/src/lib/libc/sys/getsockname.2 Fri Feb 8 02:28:18 2002
+++ getsockname.2 Tue Aug 13 02:08:05 2002
@@ -71,6 +71,8 @@
The argument
.Fa s
is a file, not a socket.
+.It Bq Er EINVAL
+The socket has been shut down.
.It Bq Er ENOBUFS
Insufficient resources were available in the system to perform the operation.
.It Bq Er EFAULT
>Release-Note:
>Audit-Trail:
>Unformatted: