Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!randvax!segue!jim From: jim@segue.segue.com (Jim Balter) Newsgroups: comp.unix.questions Subject: Re: Starting a daemon on a SVR3 Message-ID: <5538@segue.segue.com> Date: 3 Jan 91 18:37:53 GMT References: <25360@adm.brl.mil> <1752@dschub.dsc.com> Reply-To: jim@segue.segue.com (Jim Balter) Organization: Segue Software, Inc. - Santa Monica, CA. +1-213-453-2161 Lines: 17 In article <1752@dschub.dsc.com> jky@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 "" 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; );