Shell – Sending sigaction / sigqueue through shell

shellsignals

I have a c++ program that handles several signals to perform different actions, using signal:

    signal(SIGHUP, signal_handler);

I wanted to extend this signal handling to allow me to send different action requests to my program, and found that using sigaction I would be able to receive extra information along with the signal:

    sigaction(SIGUSR1, &act, 0);

For what I could find, I am able to send this type of signals from other programs, setting extra information on the sigval object, so that I know, on the receiving end, what the program was requested to do.

What I wanted to know is how can I send this type of signal information through a shell script on bash. Is it possible? I can send signals to my program using kill -S SIGHUP [PID] but I do not find a way to send that extra parameter using kill, so I was wondering if bash has any command that emulates the sigaction / sigqueue behaviour, allowing me to send signals to my app without having to develop another application to do the job.

Best Answer

Your information seems to be outdated. From my sigaction man page:

Undocumented. Before the introduction of SA_SIGINFO it was also possible to get some additional information, namely by using a sa_handler with second argu- ment of type struct sigcontext. This use is obsolete now.

Related Question