Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!petrus!scherzo!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.unix-wizards Subject: Re: Conventional daemons Message-ID: <364@hadron.UUCP> Date: Tue, 8-Apr-86 01:03:21 EST Article-I.D.: hadron.364 Posted: Tue Apr 8 01:03:21 1986 Date-Received: Thu, 10-Apr-86 01:22:17 EST References: <2177@brl-smoke.ARPA> <44@rtgvax.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 15 Summary: Look at stdio.h In article <44@rtgvax.UUCP> ksh@rtgvax.UUCP (Kent S. Harris) writes: >In article <2177@brl-smoke.ARPA>, bzs%bostonu.csnet@csnet-relay.arpa (Barry Shein) writes: >> The real question was, why open anything? Surely there's >> nothing functionally useful about opening stdin/stdout on >> "/" and it could be a potential hazard if ported. >some hard coded constants reguarding fd's < 3 (I know the kernel doesn't >give two hoots about particular fd's). The idea is to close >all fd's, open "/", and dup this fd to 1 and 2 so any new opens will >be allocated fd's >= 3. /usr/include/stdio.h: #define stdin (&_iob[0]) #define stdout (&_iob[1]) #define stderr (&_iob[2])