Date: Thu, 30 Mar 2006 07:46:42 -0500 (EST) From: Daniel Eischen <deischen@freebsd.org> To: Frank Behrens <frank@pinky.sax.de> Cc: Peter Jeremy <peterjeremy@optushome.com.au>, freebsd-current@freebsd.org Subject: Re: _cleanup() vs Linux fcloseall() Message-ID: <Pine.GSO.4.43.0603300744410.29813-100000@sea.ntplx.net> In-Reply-To: <200603300905.k2U95mXN031215@pinky.frank-behrens.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 30 Mar 2006, Frank Behrens wrote: > Peter Jeremy <peterjeremy@optushome.com.au> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0603300744410.29813-100000>