Trapping SIGTSTP and then suspeding

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Oct 7 10:47:12 AEST 1989


In article <T45126.89Oct6084404 at iemisi.dhc> t45126 at iemisi.dhc (John Durko) writes:
-Can someone help me with a problem.  I am trying to trap signal 18 (SIGTSTP)
-so that i can reset some terminal stuff before program is suspend by ^Z.  The
-question is how to i actually suspend the program.  I have tried saving the
-value returned from signal() and then calling it from my handler routine but
-the program core dumps with a segmentation fault.

Your signal handler should block the signal, act on it, reset the action
to the original return from the signal() call that planted your handler,
then send another occurrence of the signal to the process via kill().



More information about the Comp.unix.wizards mailing list