Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bria!mike From: mike@bria.AIX (Mike Stefanik/78125) Newsgroups: comp.unix.questions Subject: Re: Starting a daemon on a SVR3 Message-ID: <316@bria.AIX> Date: 4 Jan 91 05:48:53 GMT References: <25360@adm.brl.mil> <1752@dschub.dsc.com> <1991Jan03.132149.3565@scuzzy.in-berlin.de> Reply-To: mike@bria.UUCP (Michael Stefanik) Organization: Briareus Corporation, Los Angeles, CA Lines: 21 In article <1991Jan03.132149.3565@scuzzy.in-berlin.de> src@scuzzy.in-berlin.de (Heiko Blume) writes: [question about closing all open file descriptors] >yes [if you have posix stuff]: > > for ( i = 0 ; i < sysconf(_SC_OPEN_MAX) ; i++ ) > close( i ); Since file descriptors are guaranteed to be assigned sequentially; whynot simply do: i=0; while ( close(i++) != -1 ) ; This would work without any soon-to-be-defunct #define's, and any gee-what- is-POSIX libraries. Just a thought. ----------------------------------------------------------------------------- Michael Stefanik, Systems Engineer (JOAT), Briareus Corporation UUCP: ...!uunet!bria!mike "If it was hard to code, it should be harder to use!"