Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/12/84; site nbs-amrf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!umcp-cs!nbs-amrf!libes From: libes@nbs-amrf.UUCP (Don Libes) Newsgroups: net.eunice Subject: _exit or exit following fork? Message-ID: <642@nbs-amrf.UUCP> Date: Sat, 18-May-85 20:12:48 EDT Article-I.D.: nbs-amrf.642 Posted: Sat May 18 20:12:48 1985 Date-Received: Sun, 19-May-85 23:50:21 EDT Distribution: net Organization: National Bureau of Standards Lines: 23 I've been hacking on news 2.10.2 and I have one problem I don't know what to do with. In visual.c there is a routine called prun() that actually performs the fork&exec's to do mail, followups and random shell commands. I've extracted the part that is pertinent: prun() { if ((pid = fork()) == 0) { /* exec */ /* child */ exit(-1); } else wait(pid); /* parent */ } If I run this piece of code, the parent gets totally screwed up. If I change the exit to _exit, it works fine! All I can conjecture is that the fork is doing a vfork and the exit() is closing some of the parents fds. If I actually exec something in the fork, however, ps says a new process really does exist. In any case, the exec'd process itself terminates with an exit, so once again, my process gets screwed. Any ideas? Don Libes {seismo,umcp-cs}!nbs-amrf!libes