PDA

View Full Version : Handling SIGSTOP by the shell



tkks
April 16th, 2013, 09:05 PM
Hi all,

I am trying to write a simple custom shell, and I need to be able to stop processes my shell runs by sending SIGSTOP to them when the user presses CTRL+Z.
But I see in the man pages that the SIGSTOP signal cannot be handled.
So how does the real shell does it? how-come when I press CTRL+Z in BASH, BASH does not stop? how does BASH route SIGSTOP to the process it is running?

Thanks a lot.

slickymaster
April 16th, 2013, 09:43 PM
See this: Job Control Signals (https://www.gnu.org/software/libc/manual/html_node/Job-Control-Signals.html)

Also, this explanation (http://superuser.com/questions/485884/can-a-process-be-frozen-temporarily-in-linux).

tkks
April 16th, 2013, 10:15 PM
ohhhh, I see. I confused SIGTSTP and SIGSTOP. D'OH!!!!


Thanks!

slickymaster
April 16th, 2013, 10:20 PM
What matters is the fact you got your doubts clarified.


EDIT: And be very welcome to the forums.

tkks
April 17th, 2013, 09:07 PM
Thanks!