From owner-freebsd-current@FreeBSD.ORG Thu Mar 30 12:46:44 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6F8B16A400; Thu, 30 Mar 2006 12:46:44 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45AD243D46; Thu, 30 Mar 2006 12:46:44 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.6/8.13.6/NETPLEX) with ESMTP id k2UCkgjl015833; Thu, 30 Mar 2006 07:46:42 -0500 (EST) Date: Thu, 30 Mar 2006 07:46:42 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Frank Behrens In-Reply-To: <200603300905.k2U95mXN031215@pinky.frank-behrens.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Peter Jeremy , freebsd-current@freebsd.org Subject: Re: _cleanup() vs Linux fcloseall() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2006 12:46:44 -0000 On Thu, 30 Mar 2006, Frank Behrens wrote: > Peter Jeremy wrote on 30 Mar 2006 19:16: > > On Thu, 2006-Mar-30 00:41:00 +0200, Maxime Henrion wrote: > > >FWIW, NetBSD has something that close all the file descriptors, and it's > > >done with fcntl(fd, F_CLOSEM) (using fcntl() on one file descriptor to > > >close all of them looks a bit weird to me, but well...). > > > > If it close any fd's numerically greater than the passed fd, that would > > make a lot of sense. > > Yes. It is also implemented in IBM AIX (and I believe in SGI IRIX, > too). > see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/libs/basetrf1/fcntl.htm fcloseall() closes and flushes all FILEs, not file descriptors. Libc needs to perform this work since that is where FILEs are allocated. fcntl() is a system call. -- DE