home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / internal / 1798 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.7 KB  |  37 lines

  1. Newsgroups: comp.unix.internals
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!att-out!pacbell.com!tandem!hood!bill
  3. From: norcott_bill@tandem.com (Bill Norcott)
  4. Subject: Re: How can a Unix process put itself in background?
  5. Message-ID: <1992Sep11.222546.3878@tandem.com>
  6. Sender: news@tandem.com
  7. Nntp-Posting-Host: hood.tsg.tandem.com
  8. Reply-To: norcott_bill@tandem.com  (Bill Norcott)
  9. Organization: Tandem Computers, Inc.
  10. References: <lma.716056953@dayton.Stanford.EDU> <1992Sep11.170405.28836@tandem.com> <18qopsINN12n@early-bird.think.com>
  11. Date: Fri, 11 Sep 1992 22:25:46 GMT
  12. Lines: 23
  13.  
  14. In article <18qopsINN12n@early-bird.think.com>, barmar@think.com (Barry Margolin) writes:
  15. |> In article <1992Sep11.170405.28836@tandem.com> norcott_bill@tandem.com  (Bill Norcott) writes:
  16. |> >If you have a POSIX 1003.1 conforming system, a process can put 
  17. |> >itself into the background with the setpgid() system call.
  18. |> 
  19. |> You still have to fork first, as the shell (or whatever process started the
  20. |> program) waits for the original process to exit.
  21.  
  22. Sure, all UNIX user processes are created by fork().  So the process
  23. that wants to put itself into the background was created by fork().
  24. And it's parent should be using waidpid() or wait() to wait for the
  25. death of the child.  But the original question was, how can the guy's
  26. existing (child) process put ITSELF in the background.  This is where
  27. setsid() and setpgid() are used.
  28.  
  29. -- 
  30. ---------------------------------------------------------------------|
  31. Bill Norcott            GUARDIAN POSIX project
  32. Tandem Computers, Inc.        
  33. 10600 N. Tantau Avenue        PHONE:  (408) 285-3253
  34. Cupertino, CA   95014        EMAIL: norcott_bill@tandem.com
  35.  
  36.  
  37.