From owner-svn-src-head@FreeBSD.ORG Mon Nov 2 18:20:25 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C59EC10656A3 for ; Mon, 2 Nov 2009 18:20:25 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 25B37161BCC for ; Mon, 2 Nov 2009 18:20:20 +0000 (UTC) Received: (qmail 21282 invoked from network); 2 Nov 2009 18:20:19 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 2 Nov 2009 18:20:19 -0000 Message-ID: <4AEF22E3.5070701@freebsd.org> Date: Mon, 02 Nov 2009 10:20:19 -0800 From: Colin Percival User-Agent: Thunderbird 2.0.0.23 (X11/20090919) MIME-Version: 1.0 To: Robert Watson References: <200911020721.nA27LDq1048764@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r198781 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2009 18:20:25 -0000 Robert Watson wrote: > On Mon, 2 Nov 2009, Colin Percival wrote: >> Attempt to reduce accidental foot-shooting by pointing out that >> accept(2)ed sockets do not necessarily inherit O_NONBLOCK from >> listening sockets on non-FreeBSD platforms. > > I wonder how much trouble we should go to to document bugs in other > systems as non-portabilities for features that work in our system. I don't think there's any simple rule to apply here except "use common sense". One can argue that FreeBSD man pages exist for the purpose of documenting FreeBSD; but I'd also like to think that FreeBSD is a good development platform for writing portable applications, so alerting our users to potentially non-portable code certainly has some value. (And there are many other examples of "portable programs should not..." in our man pages, not just the one I added.) The non-portability I just documented was a particularly obnoxious one, since in event-driven code it can go unnoticed for a long time -- as I just recently discovered. > I think a more general caution for accept(2) might instead be: > > BUGS > The inheritence of socket options from a listen socket to a newly > accepted socket is inconsistent across protocols, and non-portable. I was originally going to write it that way, but when I looked at the existing text I saw that it only mentioned inheriting O_NONBLOCK and said nothing about other options -- so I figured that it was appropriate to follow suit and only mention O_NONBLOCK in saying what was non-portable. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid