home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5257 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.3 KB  |  30 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!caen!batcomputer!theory.TC.Cornell.EDU!mdw
  3. From: mdw@theory.TC.Cornell.EDU (Matt Welsh)
  4. Subject: Re: Creating a background process from within C prog
  5. Message-ID: <1992Nov12.060621.2342@tc.cornell.edu>
  6. Sender: news@tc.cornell.edu
  7. Nntp-Posting-Host: theory.tc.cornell.edu
  8. Organization: Cornell Theory Center
  9. References: <1992Nov11.032950.23086@leland.Stanford.EDU> <1992Nov12.003035.24322@tc.cornell.edu> <1992Nov12.020913.19659@leland.Stanford.EDU>
  10. Date: Thu, 12 Nov 1992 06:06:21 GMT
  11. Lines: 17
  12.  
  13. In article <1992Nov12.020913.19659@leland.Stanford.EDU> dkeisen@leland.Stanford.EDU (Dave Eisen) writes:
  14. >
  15. >No no no.... Do the system in the parent. My point is that
  16. >if you are going to do a "system", there is no reason to
  17. >fork in the parent. The system statement above runs ls
  18. >in the background without having to do any explicit forks.
  19.  
  20. Aha. Right you are, system() can handle the spawning quite nicely for you. :)
  21. I thought you were referring to just replacing the system() inside of the
  22. fork with the backgrounded one.
  23.  
  24. However I don't trust system(), something about running a shell for one
  25. command bothers me, or maybe it's just that I like to know exactly what I'm
  26. doing (picky parents pick execv(), or something like that).
  27.  
  28. mdw
  29.  
  30.