Parameters in the signal handler

0

I have a question and even after research I could not solve it.

Let's say I have the following signal handler:

struct sigaction conf_signal;
conf_signal.sa_flags = 0;
sigemptyset(&conf_signal.sa_mask);
conf_signal.sa_handler = &sinal_chegou;

And the following code inside a for:

    if (sigaction(SIGINT, &conf_signal, NULL) == -1) {
        perror("sigaction");
        exit(EXIT_FAILURE);
    }

And my sinal_chegou function has the following signature:

void sinal_chegou(void){

How do I send a received parameter in argv[] to the sinal_chegou function using the signal handler?

    
asked by anonymous 29.09.2016 / 19:12

1 answer

0

Use a global variable. I do not think there is any other way.

    
29.09.2016 / 19:17