From owner-freebsd-hackers Mon Jan 29 12: 0:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id AA9E337B400 for ; Mon, 29 Jan 2001 12:00:25 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id PAA37796; Mon, 29 Jan 2001 15:00:23 -0500 (EST) (envelope-from wollman) Date: Mon, 29 Jan 2001 15:00:23 -0500 (EST) From: Garrett Wollman Message-Id: <200101292000.PAA37796@khavrinen.lcs.mit.edu> To: Luigi Rizzo Cc: hackers@FreeBSD.ORG Subject: Re: [kernel patch] fcntl(...) to close many descriptors In-Reply-To: <200101291926.f0TJQYK34514@iguana.aciri.org> References: <20010129112337.Y26076@fw.wintelcom.net> <200101291926.f0TJQYK34514@iguana.aciri.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > but there is a problem with syscall() in that according to > the manpages it cannot handle in/out parameters as instead > it is supported by ioctl/fcntl Of course it can, and the manual page doesn't even suggest what you say. It says: There is no way to simulate system calls that have multiple return values such as pipe(2). pipe(2) is a special case in that it returns two values rather than one. The actual pipe(2) system call has *no* formal parameters; the unpacking of the two values returned into the declared C formal parameter is done by an assembly-language stub. (This was done for reasons of speed; it is much faster to return two values than it is to copyout() a two-element array. If you were implementing a Lisp binding of POSIX, you would probably define PIPE to be a niladic function which returns a list of two descriptors. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message