Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!ulysses!ulysses.att.com!smb From: smb@ulysses.att.com (Steven Bellovin) Newsgroups: comp.unix.wizards Subject: Re: more BSD strangeness -- syslogd.c Message-ID: <13093@ulysses.att.com> Date: 11 Jun 90 15:10:40 GMT References: <1990Jun8.070904.7466@athena.mit.edu> <36447@sequent.UUCP> <3446@auspex.auspex.com> Sender: netnews@ulysses.att.com Lines: 13 In article <3446@auspex.auspex.com>, hitz@auspex.auspex.com (Dave Hitz) writes: } This answers the question "why close all open files", but it doesn't } answer the question, "why open anything at all for descriptors 0, 1 and } 2." If it makes no reference to stdin, stdout, stderr, why must there } be something open for them? } } I can (and have) made up several answers for this. Anyone know the real } one? What happens if you just leave the descriptors closed? It probably doesn't apply to syslogd, but in general if 0,1,2 are closed you confuse a lot of programs that you fork/open/dup/exec to. Yes, I've seen it happen. Many times.