From owner-svn-src-all@FreeBSD.ORG Tue Jun 16 06:10:28 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 919561065672; Tue, 16 Jun 2009 06:10:28 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (cl-2958.ham-01.de.sixxs.net [IPv6:2001:6f8:900:b8d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 17D508FC1B; Tue, 16 Jun 2009 06:10:27 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.3/8.14.3) with ESMTP id n5G6AQ5S013730; Tue, 16 Jun 2009 10:10:26 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Tue, 16 Jun 2009 10:10:26 +0400 (MSD) From: Maxim Konovalov To: John Baldwin In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> Message-ID: <20090616100839.P5283@mp2.macomnet.net> References: <200906152038.n5FKctaR001026@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Tue, 16 Jun 2009 06:10:29 -0000 kern/121522 and more or less related kern/19363. On Mon, 15 Jun 2009, 20:38-0000, John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 > > Log: > Add a new 'void closefrom(int lowfd)' system call. When called, it closes > any open file descriptors >= 'lowfd'. It is largely identical to the same > function on other operating systems such as Solaris, DFly, NetBSD, and > OpenBSD. 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. > > Note that this implementation of closefrom(2) does not make any effort to > resolve userland races with open(2) in other threads. As such, it is not > multithread safe. > > Submitted by: rwatson (initial version) > Reviewed by: rwatson > MFC after: 2 weeks > -- Maxim Konovalov