Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Denver Mods 7/26/84) 6/24/83; site drutx.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!drutx!zarth From: zarth@drutx.UUCP (CovartDL) Newsgroups: net.lang.c Subject: exit() and wait() Message-ID: <2541@drutx.UUCP> Date: Thu, 18-Apr-85 18:46:18 EST Article-I.D.: drutx.2541 Posted: Thu Apr 18 18:46:18 1985 Date-Received: Fri, 19-Apr-85 01:32:18 EST Organization: AT&T Information Systems Laboratories, Denver Lines: 20 Thanks for all the responses to my previous net news article. My code contained the line: if((pid = fork()) == -1) when I typed it in I got it wrong. Everyone caught that. Also, the agrument to wait almost everyone caught. was: while((wid == wait((unsigned int*)rtn_code)) != pid); should be: while((wid == wait(&rtn_code)) != pid); Several people expressed intreset into why I used a while statement. This was done because if someone else invokes this procedure from another procedure which forked of a child but didn't wait for it, that childs termination could cause this wait to wake up. Thanks again for all the help I have my program working fine now. Posted this so others can benifiet too. Zarth Arn