how to suspend a process

David Elliott dce at smsc.sony.com
Thu Feb 7 06:19:01 AEST 1991


In article <121503 at uunet.UU.NET>, rbj at uunet.UU.NET (Root Boy Jim) writes:
|> In article <7016 at alpha.cam.nist.gov> coleman at cam.nist.gov (Sean Sheridan Coleman X5672) writes:
|> >In a program I am writing, I want to be able to catch SIGTSTP
|> >but if I do that, the process will not get suspended. How can
|> >I do what the shell would do under normal situation, suspend the
|> >process? Is sigsuspend the way to go? 
|> 
|> In your handler, you send yourself a SIGSTOP, which you cannot catch.
|> You could also unregister your handler, then send a SIGTSTP.

It may be a trivial point, but it's nice to have the signal that
stops the program be the one that was intended to stop the
program.

If you send a SIGSTOP to a program, csh (and probably others) tell
you it was stopped by a signal.  If SIGTSTP is used, the output
from csh is different.

So, if you are stopping your program in response to some user input,
it looks better if SIGTSTP is the signal that does the stopping.

-- 
...David Elliott
...dce at smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
..."His lower lip waved poutily with defiance..."



More information about the Comp.unix.questions mailing list