Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site talcott.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!talcott!kendall From: kendall@talcott.UUCP (Sam Kendall) Newsgroups: net.lang.c Subject: Re: Re: putting C programs in the background Message-ID: <243@talcott.UUCP> Date: Sun, 20-Jan-85 14:24:52 EST Article-I.D.: talcott.243 Posted: Sun Jan 20 14:24:52 1985 Date-Received: Mon, 21-Jan-85 04:39:12 EST References: <4600@cbscc.UUCP> <1269@bbncca.ARPA> Organization: Sociology Dept., Harvard Univ. Lines: 22 > >To put a C program in the background . . . . > > Almost. Actually, a little too simple. Better: > > pid = fork(); > if( pid < 0 ) > { > /* Print error message */ > exit(1); > } > else if( pid > 0 ) > { > /* parent */ > exit(0); > } > /* else pid == 0, this is the child. Continue */ Those "exit" calls should be "_exit", to avoid duplication of buffered output. Sam Kendall {allegra,ihnp4,ima,amd}!wjh12!kendall Delft Consulting Corp. decvax!genrad!wjh12!kendall