lkml.org 
[lkml]   [1999]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: FD_CLFORK or equivalent?
On Wed, 5 May 1999, Bernd Eckenfels wrote:

> In article <Pine.QNX.3.96.990504112943.30630A-100000@sam.cogent.ca> you wrote:
> > If not, before I hack one in as a private kernel patch, is
> > there any reason to add such a mechanism, perhaps a FD_CLOFORK
> > flag, and does anybody have suggestions on where to start?
>
> A reason would be, that this is a good way of making daemons. Since closing
> all fds from 0-255 is not enough on systems where high-numberes fds can be
> open.
>
But... The 'standard' way is:

fd = open("/", O_RDONLY);
while (fd >= 0) (void)close(fd--);


Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.109 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site