From owner-freebsd-hackers Mon Jan 29 9:38:36 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id A969437B402 for ; Mon, 29 Jan 2001 09:38:14 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id f0THbWg65163; Mon, 29 Jan 2001 09:37:32 -0800 (PST) (envelope-from dillon) Date: Mon, 29 Jan 2001 09:37:32 -0800 (PST) From: Matt Dillon Message-Id: <200101291737.f0THbWg65163@earth.backplane.com> To: "Jacques A. Vidrine" Cc: mouss , Garance A Drosihn , Luigi Rizzo , hackers@FreeBSD.ORG, wollman@khavrinen.lcs.mit.edu Subject: Re: [kernel patch] fcntl(...) to close many descriptors References: <200101290303.f0T33qg60603@earth.backplane.com> <200101281837.f0SIbGI24332@iguana.aciri.org> <200101290303.f0T33qg60603@earth.backplane.com> <4.3.0.20010129145823.023dfeb0@pop.free.fr> <20010129081455.B2390@hamlet.nectar.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :> 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. This is a bad idea. One of the reasons why it is so easy for us to write portability modules for Sun, Linux, etc... is because of the hard-coded syscall numbers. Syscalls work plenty well enough as they are now, we do not need a new mechansm. :> (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 mmap() is overloaded for MAP_ANON. fcntl() may not be perfect, but it's better then adding a new syscall. The libc closeall() code (I'm assuming that Mouss does not intend to actually use a #define) could do the fcntl(), and if it fails fall back to close()ing descriptors in a loop. Perfect! -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message