Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!uwvax!cottage!lm From: lm@cottage.WISC.EDU (Larry McVoy) Newsgroups: comp.unix.questions Subject: Re: SIGSTOP - what is it? Message-ID: <3800@spool.WISC.EDU> Date: Fri, 3-Jul-87 14:23:48 EDT Article-I.D.: spool.3800 Posted: Fri Jul 3 14:23:48 1987 Date-Received: Sat, 4-Jul-87 13:55:32 EDT References: <3786@spool.WISC.EDU> <13114@topaz.rutgers.edu> Sender: news@spool.WISC.EDU Reply-To: lm@cottage.WISC.EDU (Larry McVoy) Organization: U of Wisconsin CS Dept Lines: 34 In article <13114@topaz.rutgers.edu> ron@topaz.rutgers.edu (Ron Natalie) writes: $ Programs that play around with the screen, use raw mode, or otherwise $ want to perform some action when the SIGTSTP (the one generated by ^Z) $ occurs use this. They catch the SIGTSTP signal and when they really $ want to stop themselves they send SIGSTOP to themselves. It's sort $ of analogous to SIGTERM and SIGKILL. Yeah, that's what I thought, but can't you do something like this: onstop() { /* put the terminal back into whatever is normal state */ normal(); signal(SIGTSTP, SIG_DFL); kill(getpid(), SIGTSTP); /* come back to here */ raw(); signal(SIGTSTP, onstop); return; } I had something like this working once - but it was a while ago. It doesn't work now and I think it might be because 4.3 does signals a little differently than the SysV/enhanced system I was working on. In particular, BSD blocks further signals while in the handler, right? So is that why the code above might not work? Surely you don't need two signals (on catchable, one not) for each "user" signal, do you? Larry McVoy lm@cottage.wisc.edu or uwvax!mcvoy