From owner-freebsd-hackers Mon Jan 29 6:15:15 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 0EDAD37B69D for ; Mon, 29 Jan 2001 06:14:57 -0800 (PST) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 9FDCD193E5; Mon, 29 Jan 2001 08:14:55 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.1/8.9.3) id f0TEEtS02428; Mon, 29 Jan 2001 08:14:55 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Mon, 29 Jan 2001 08:14:55 -0600 From: "Jacques A. Vidrine" To: mouss Cc: Garance A Drosihn , Matt Dillon , Luigi Rizzo , hackers@FreeBSD.ORG, wollman@khavrinen.lcs.mit.edu Subject: Re: [kernel patch] fcntl(...) to close many descriptors Message-ID: <20010129081455.B2390@hamlet.nectar.com> References: <200101290303.f0T33qg60603@earth.backplane.com> <200101281837.f0SIbGI24332@iguana.aciri.org> <200101290303.f0T33qg60603@earth.backplane.com> <4.3.0.20010129145823.023dfeb0@pop.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <4.3.0.20010129145823.023dfeb0@pop.free.fr>; from usebsd@free.fr on Mon, Jan 29, 2001 at 03:13:05PM +0100 X-Url: http://www.nectar.com/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Jan 29, 2001 at 03:13:05PM +0100, mouss wrote: > I fully agree that we'd better mimic netbsd than aix... > but the netbsd closeall() is just a libc function that calls close() > for all descriptors. so we can still mimic it with: > > #define closeall(start) fcntl(start, F_CLOSEM, 0) Better a function than a macro. > and with this, we have both netbsd and aix compat. note that if I > do it for freebsd, I'll do the same for netbsd and openbsd (I'm a fan of > *BSD convergence [I don't mean they should be the same, but unjustified > diffs should be killed whenever possible]:). > > As for the "generic" syscall mechanism, I'd love it. I think that > there are many places where "names" would be good, instead of > hardcoded numbers. The only problem is to find a way to do that > without reducing performance. names are good. just try to see what it > would be if filenames were replaced by inodes. I think that having a > name-based mechanism makes it easier to add new syscalls or reject > deprecated ones. Performance is not much of an issue. A perfect hash can be generated for syscall names. [snip] > back to the closeall, here is what I suggest: > - add the fcntl option. the coherence arg is certainly reasonable, but > fcntl is not a "cohrent" function > (thanks to svr4 lobbying into posix:). > - add a closeall macro to call it. > > this gives both aix and netbsd compat (and if the fcntl thing goes into > netbsd, the compat would be full). I really do not care for using fcntl with this. fcntl operates on a single file descriptor -- F_CLOSEM mucks up the interface. -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message