home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / internal / 1805 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!smurf.sub.org!news
  2. From: urlichs@smurf.sub.org (Matthias Urlichs)
  3. Newsgroups: comp.unix.internals
  4. Subject: Re: How can a Unix process put itself in background?
  5. Date: 13 Sep 1992 16:46:02 +0200
  6. Organization: University of Karlsruhe, FRG
  7. Lines: 23
  8. Message-ID: <18vk7aINN5b2@smurf.smurf.sub.org>
  9. References: <1992Sep11.222546.3878@tandem.com> <18rlr4INNi23@early-bird.think.com> <ceggQDG00VozICsUcq@andrew.cmu.edu>
  10. NNTP-Posting-Host: 127.0.0.1
  11.  
  12. In comp.unix.internals, article <ceggQDG00VozICsUcq@andrew.cmu.edu>,
  13.   fl0p+@andrew.cmu.edu (Frank T Lofaro) writes:
  14. > This is a real obscene way of getting it to work, and it very well might
  15. > not work. However, you should give it a try:
  16. [ Fork a child, stop the parent, make child continue parent and exit ]
  17.  
  18. I thought of this too, and it's sick. :-)  The only problem is that the shell
  19. doesn't notice when the process continues; its state is still "stopped" until
  20. you put it into the background, which of course has no effect on the process.
  21.  
  22. Job control works as expected, i.e. when the backgrounded process tries to
  23. read/write stdin it gets SIGTTIN/SIGTTOU and you can "fg" it from there.
  24. setsid() and setpgrp() don't seem to affect its behavior if you leave
  25. stdin/stdout alone.
  26.  
  27. -- 
  28. Well, see, Joyce, there we were, trapped in the elevator.  Now, I had
  29. my tennis racquet and the goldfish; she was holding the Crisco.  Surely
  30. you can imagine how one thing naturally led to another!
  31. -- 
  32. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  33. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  34.