Starting a daemon on a SVR3

Trip Martin night at itsgw.rpi.edu
Sat Jan 5 00:13:38 AEST 1991


mike at bria.AIX (Mike Stefanik/78125) writes:

>In article <1991Jan03.132149.3565 at scuzzy.in-berlin.de> src at scuzzy.in-berlin.de (Heiko Blume) writes:
>[question about closing all open file descriptors]
>>yes [if you have posix stuff]:

>Since file descriptors are guaranteed to be assigned sequentially; whynot
>simply do:

>	i=0;
>	while ( close(i++) != -1 )
>		;

This won't work because there's nothing stopping the program from closing
file descriptors.  As an example, suppose the process had open file
descriptors 0 through 7, and then closed 3.  This code would leave open
4 through 7.

-- 
Trip Martin  
night at rpi.edu
-- 
Trip Martin  
night at rpi.edu



More information about the Comp.unix.questions mailing list