Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!hcx1!hcx3!shirono From: shirono@hcx3.SSD.HARRIS.COM Newsgroups: comp.unix.questions Subject: Re: Signals Message-ID: <48200018@hcx3> Date: 9 Feb 89 22:21:00 GMT References: <89@ Lines: 33 Nf-ID: #R: 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@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.