What keyboard signal can I catch besides Ctrl-C?

I have an application (C, Linux) that processes Ctrl-C SIGINT, turning it off. I would like to add another signal handler so that I can use a different key combination to "reload the configuration while I work."

So, I look from a signal that I can send to the forefront by pressing a key, which does not make the process exit or pause. Are there any others?

+6
source share
3 answers

You can use ctrl+Z ,

 SIGTSTP 

Value = 20

See the link for more details.

+8
source

You can try Ctrl - \ , which is SIGQUIT , if you absolutely need it to be a keystroke (you can catch it).

+3
source

Your program can use SIGUSR1 and SIGUSR2 to do whatever it wants, but there is no one-way way to send them as Ctrl + C sends a SIGINT signal. You should use something like kill(1) to send a signal, for example. kill -USR1 <mypid> .

+2
source

Source: https://habr.com/ru/post/912019/


All Articles