fanedd has asked for the wisdom of the Perl Monks concerning the following question:
I am overwriting the default signal handler for TSTP signal, which will increment a flag. After this, I want the program to be suspended, so I can send it to background.
I tried to send the STOP signal after the program resumes execution, but the problem is that that can be anytime, and I want to keep the code relatively clean.I also tried to send the signal from inside the signal handler, but that causes some core dumps from time to time. Another thing that I tried is to tie the flag, and in the STORE method send the STOP, but this also gets executed when handling the signal.
Is there a way that I can maybe call STOP on resume, or call the default signal handler after I increment my flag?Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suspending after catching TSTP
by haukex (Archbishop) on Feb 08, 2019 at 19:39 UTC |