Re: Question on SIGSTOP

junky_fellow_at_yahoo.co.in
Date: 03/30/05


Date: 30 Mar 2005 00:11:46 -0800


Minti wrote:
> ****o,
>
> What is the the behaviour of "overloading" the SIGSTOP? When I try
to
> provide a handler for it using signal, I get SIG_ERR. However bash,
csh
> and other s****s seem to be able to provide handlers for SIGSTOP for
> when I press "Ctrl+Z" or when I do "kill -SIGSTOP process_id" I get a
> "STOPPED message".
>
> TIA
>
>
> --
> Imanpreet Singh Arora
> PS. The website http://basicbash.activeventure.net/sect_12_01.html
> says that Ctrl+Z sends SIGTSTP rather than SIGSTOP. Is this correct?

The signal SIGSTOP cannot be caught or ignored. So, you cannot provide
a handler for this. The SIGSTOP will always stop the process to which
it
is posted.
The SIGTSTP is an interactive stop signal. It can be handled and
ignored.
Your program should handle this signal if you have a special need to
leave
files or system tables in a secure state when a process is stopped. For

example, programs that turn off echoing should handle SIGTSTP so they
can
turn echoing back on before stopping.