Re: _cleanup() vs Linux fcloseall()



Peter Jeremy <peterjeremy@xxxxxxxxxxxxxxxx> 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

--
Frank Behrens, Osterwieck, Germany
PGP-key 0x5B7C47ED on public servers available.

_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: O_DIRECT on stdin?
    ... > There is no O_DIRECT or fcntl() in Standard C. ... > fcntloperates on an open file descriptor, ... > for stdin is 0. ...
    (comp.unix.programmer)
  • Re: strace newbie
    ... The reading and writing to 0 and 1 are stdin/stdoout. ... I don't see the open returning file descriptor 3 so I can't ... The program has done an fcntl setting the descriptor to read/write. ... You can get more details using the "man" command. ...
    (comp.os.linux.misc)
  • Re: query a file descriptor
    ... >> If You Want Breakfast In Bed, Sleep In the Kitchen. ... > fcntl does this. ... Make sure you test the flags correctly... ... It probably only returns the flags with which the file descriptor ...
    (comp.unix.programmer)
  • Re: _cleanup() vs Linux fcloseall()
    ... On Thu, 30 Mar 2006, Frank Behrens wrote: ... on one file descriptor to ... Libc needs to perform this work since that is where FILEs are ... fcntl() is a system call. ...
    (freebsd-current)