From owner-svn-src-all@FreeBSD.ORG Mon Jun 15 20:49:35 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 01DA81065675 for ; Mon, 15 Jun 2009 20:49:35 +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 5D73C155577 for ; Mon, 15 Jun 2009 20:49:34 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 18272 invoked from network); 15 Jun 2009 20:49:38 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2009 20:49:38 -0000 Message-ID: <4A36B3E2.7060309@freebsd.org> Date: Mon, 15 Jun 2009 14:49:38 -0600 From: Colin Percival User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: John Baldwin References: <200906152038.n5FKctaR001026@svn.freebsd.org> In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 20:49:35 -0000 John Baldwin wrote: > One difference from other *BSD is that this closefrom() does not > fail with any errors. In practice, while the manpages for NetBSD and > OpenBSD claim that they return EINTR, they ignore internal errors from > close() and never return EINTR. DFly does return EINTR, but for the common > use case (closing fd's prior to execve()), the caller really wants all > fd's closed and returning EINTR just forces callers to call closefrom() in > a loop until it stops failing. Wouldn't it be better for portability if closefrom(2) is defined to return an int, even if the value returned is always zero? Otherwise people who want to write code which works on all BSDs end up having to do something like #ifdef __FreeBSD__ closefrom(x); #else while (closefrom(x)) continue; #endif -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid