Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site motel6.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!tektronix!reed!motel6!keith From: keith@motel6.UUCP (Keith Packard) Newsgroups: net.unix-wizards Subject: Re: Conventional daemons Message-ID: <203@motel6.UUCP> Date: Mon, 24-Mar-86 15:52:14 EST Article-I.D.: motel6.203 Posted: Mon Mar 24 15:52:14 1986 Date-Received: Wed, 26-Mar-86 06:47:39 EST References: <261@bu-cs.UUCP> <328@hadron.UUCP> Reply-To: keith@motel6.UUCP (Keith Packard) Organization: 5440 SE 41st, Portland, OR Lines: 19 In article <261@bu-cs.UUCP> ccc@bu-cs.UUCP (Cameron Carson) writes: > int s; > for (s = 0; s < SOME_NUM; s++) > (void) close(s); > (void) open("/",0); > (void) dup2(0,1); > (void) dup2(0,2); >My question is: why open "/" ? Why not open something a little >less vital like, say, /dev/null? Well, I suspect the answer to this lies in the dim dark past when unix ran on small machines. The inode for "/" is always in memory, the inode for "/dev/null" is only in memory when it is referenced. So, opening "/" instead of "/dev/null" will not cause another inode-table entry to be filled up. Useful when your system only has 50 or so incore inodes, considering that the daemon will *always* be running. Keith Packard ...!tektronix!reed!motel6!keith