Starting a daemon on a SVR3
Jim Balter
jim at segue.segue.com
Fri Jan 4 05:37:53 AEST 1991
In article <1752 at dschub.dsc.com> jky at neptune.dsc.com (Jacob Kan Yu) writes:
|What's about this:
|
| for ( i = 0 ; i < NOFILE ; i++ )
| close( i );
|
|The problem I have is that "NOFILE" is 20 for System V/386 Release 3.0 and is
|60 for Release 3.2 and the comments in "<sys/param.h>" says this number is
|no longer a constant and should be removed in the next release. Anybody
|have better idea?
/* assuming fd 0 is known to be open */
while ( dup(0) == 0 );
/* for ( i = 0; close(i++) == 0; ); */
/* guard against NFS brain damage */
for ( i = 0; close(i++) == 0 || errno != EBADF; );
More information about the Comp.unix.questions
mailing list