From owner-freebsd-hackers Wed Nov 18 15:26:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA28532 for freebsd-hackers-outgoing; Wed, 18 Nov 1998 15:26:39 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cerebus.nectar.com (nectar-gw.nectar.com [204.0.249.101]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA28508 for ; Wed, 18 Nov 1998 15:26:22 -0800 (PST) (envelope-from nectar@nectar.com) Received: (from smap@localhost) by cerebus.nectar.com (8.9.1/8.9.1) id RAA04046; Wed, 18 Nov 1998 17:25:41 -0600 (CST) (envelope-from nectar@nectar.com) Received: from spawn.nectar.com(10.0.0.101) by cerebus.nectar.com via smap (V2.1) id xma004042; Wed, 18 Nov 98 17:25:33 -0600 Received: from spawn.nectar.com (localhost.nectar.com [127.0.0.1]) by spawn.nectar.com (8.9.1/8.9.1) with ESMTP id RAA11250; Wed, 18 Nov 1998 17:25:33 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Message-Id: <199811182325.RAA11250@spawn.nectar.com> X-Mailer: exmh version 2.0.2 2/24/98 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: lists/freebsd X-PGP-RSAfprint: 00 F9 E6 A2 C5 4D 0A 76 26 8B 8B 57 73 D0 DE EE X-PGP-RSAkey: http://www.nectar.com/nectar-pgp262.txt From: Jacques Vidrine In-reply-to: <000BCF69.C21023@mail.ing.nl> References: <000BCF69.C21023@mail.ing.nl> Subject: Re: kern/8629: accept (2) errno uses incorrect code To: Peter.Mutsaers@mail.ing.nl cc: hackers@FreeBSD.ORG Date: Wed, 18 Nov 1998 17:25:33 -0600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- [sending to -hackers to solicit comments regarding PR 8629] On 17 November 1998 at 11:03, Peter.Mutsaers@mail.ing.nl wrote: [regarding operating systems which return EOPNOTSUPP from accept when called with a socket _not_ of type SOCK_STREAM] > Solaris 2.6 and Digital UNIX 4.0 do. I tested my program on them > > Output from a small program doing an accept on socket 69/udp (tftp), using > perror to show the errno value: [summary from Peter's experience and mine: Returns EINVAL Returns EOPNOTSUPP 4.4 BSD Lite2 FreeBSD NetBSD OpenBSD AIX 3.2.5 AIX 4.1 HP-UX 10.20 HP-UX 10.30 Linux 2.1.128 AIX 4.2 Solaris 2.6 Digital UNIX 4.0 ] > Actually I should look it up in the POSIX spec but I don't have one at hand. Yes, if POSIX has something to say about it, then that has to be definitive. > However the number of Unices doing it like the original manpage, and the fact > that AIX 4.1 --> 4.2 > modified it to comply, convinces me that really it should return EOPNOTSUPP. I'm far from convinced. See above. Additionally, the BSD and Linux accept() code is ``correct'' in that checking the type of the socket (and therefore returning EOPNOTSUPP) would be an additional, redundant check. Checking whether or not the socket is in a ``listening state'' is sufficient. So far it seems as if BSD implementations return EINVAL, while System V implementations return EOPNOTSUPP. The Linux implementation is homegrown, but returns EINVAL in this situation for the same reasons the BSD code does. Since the sockets interface is defined by BSD, I expect that BSD is correct, and that the System V vendors got it wrong. I can't blame them, though, since BSD has had the manual page wrong forever. Jacques Vidrine / n@nectar.com / nectar@FreeBSD.org -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNlNXbTeRhT8JRySpAQGwrAQAsqrOv4AY6FcphYZIA92g4GjnZtUzHoH9 DEdsWjc2hiN6vj9GvPmlbpfUObk/htLeS7ncBGSZouGkpjx/2Rpv0JjjTh35u1bI VtrEpkQVfcOgc0TWUu52WKeOcb8WExwZ+KPsoYzEIdU6Wz6FEP0c+iT6ri5v+d+w VWCoYVyqdig= =kcSM -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message