Signals

shirono at hcx3.SSD.HARRIS.COM shirono at hcx3.SSD.HARRIS.COM
Fri Feb 10 08:21:00 AEST 1989


In comp.unix.questions, pete at titan.titan.rice.edu writes:
> I'm trying to write a simple implementation of an Unix shell to be used as a 
> lab in a class, but I'm having problems handling ^Z. 
>
> I install a handler for SIGTSTP via 'signal' and then send SIGSTOP to the
> proper child via 'kill'. 'ps' says at this point the child is stopped and
> soon swaps out. The parent is marked as sleeping. A 'printf' call followed
> by a fflusch call immediately follows the 'kill', but it never happens.
            ^

First, remember it is not necessarily ^Z.  It is whatever you told the
terminal driver to interpret as the suspend character.

You say you send SIGSTOP.  That is most definitely going to stop your process.
You have no say in the matter.

SIGSTOP and SIGTSTP are two different signals.  The first one cannot be
caught, blocked or ignored.  The second one is the stop signal generated from
the keyboard.  Do not mix them.

Good luck.

--Roberto
______________________________________________________________________________
                               ||   Internet: shirono at ssd.harris.com
     Roberto Shironoshita      ||
      Harris Corporation       ||             ...!novavax---\
   Computer Systems Division   ||   UUCP:     ...!uunet-------!hcx1!shirono
                               ||             ...!mit-eddie-/
------------------------------------------------------------------------------
DISCLAIMER: The opinions expressed here are my own; they in no way reflect the
            opinion or policies of Harris Corporation.



More information about the Comp.unix.questions mailing list