home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5238 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.0 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!das-news.harvard.edu!husc-news.harvard.edu!husc-news!huang1
  2. From: huang1@husc10.harvard.edu (Howard Huang)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: Creating a background process from within C prog
  5. Message-ID: <HUANG1.92Nov10171831@husc10.harvard.edu>
  6. Date: 11 Nov 92 01:18:31 GMT
  7. Article-I.D.: husc10.HUANG1.92Nov10171831
  8. References: <1992Oct27.103059.60148@cc.usu.edu> <BwsyCt.9Gx@acsu.buffalo.edu>
  9. Organization: Harvard Arts and Sciences Computer Services, Cambridge, MA
  10. Lines: 14
  11. Nntp-Posting-Host: husc10.harvard.edu
  12. In-reply-to: jcmurphy@acsu.buffalo.edu's message of 27 Oct 92 22:55:41 GMT
  13.  
  14. jcmurphy@acsu.buffalo.edu (Jeff Murphy) writes:
  15.  
  16.      kiddo = fork();
  17.  
  18.      if (kiddo == 0)
  19.        {      
  20.      system("ls > /tmp/myfile");
  21.      exit(0);
  22.        }  
  23.      printf("world\n");
  24.  
  25. In a real application be sure you check the return value of fork for
  26. errors.  For example, fork will fail if the user has reached his/her
  27. process limit.
  28.