Date: Thu, 6 Dec 2012 20:48:49 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Kevin Lo <kevlo@kevlo.org> Cc: freebsd-net@FreeBSD.org Subject: Re: Review request: fix return value of socket(2) on no family found Message-ID: <20121206164849.GE48639@FreeBSD.org> In-Reply-To: <50C03D8F.3090106@kevlo.org> References: <50C03D8F.3090106@kevlo.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Kevin, On Thu, Dec 06, 2012 at 02:39:11PM +0800, Kevin Lo wrote: K> Here's the patch mostly from NetBSD to make socket(2) return EAFNOSUPPORT K> rather than EPROTONOSUPPORT if the family cannot be found. K> K> http://people.freebsd.org/~kevlo/patch-socket K> K> The man page documents the behavior specified in POSIX.1-2008: K> K> http://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html K> K> For reference, Linux, NetBSD, and OS X return EAFNOSUPPORT for this. IMO, the proposed change is correct. I'd suggest only couple of things: - Please commit the addition of the pffinddomain() function and its documentation separately from socket() return value change. - May be it is worth to have a comment with reference to POSIX in the code in uipc_socket.c, that selects approptiate error value. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121206164849.GE48639>