Trapping SIGTSTP and then suspeding

Donald Vaughn Faulkner faulkner at megan.Apollo.COM
Tue Oct 10 02:49:00 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.  If anyone could give me
> some pointers i would appreciate it.  By the way i'm using SunOS 4.0.3.

the value returned by signal is probably "0" --- default handler, y'know...
You can use  "kill (getpid (), SIGSTOP)" to suspend yourself.
--
Don Faulkner       Customer Service
OS Products        Apollo Computer
faulkner at apollo.hp.com



More information about the Comp.unix.wizards mailing list