Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!dimacs.rutgers.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.questions Subject: Re: how to suspend a process Message-ID: <1991Feb6.191901.3676@smsc.sony.com> Date: 6 Feb 91 19:19:01 GMT References: <7016@alpha.cam.nist.gov> <121503@uunet.UU.NET> Sender: dce@smsc.sony.com (David Elliott) Reply-To: dce@smsc.sony.com (David Elliott) Organization: Sony Microsystems, San Jose, CA Lines: 27 In article <121503@uunet.UU.NET>, rbj@uunet.UU.NET (Root Boy Jim) writes: |> In article <7016@alpha.cam.nist.gov> coleman@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@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce ...(408)944-4073 ..."His lower lip waved poutily with defiance..."