I am using sigaction() to perform an action every time SIGINT is received. All tutorials I have seen use this prototype as a signal handler
void sig_handler(int sig);
Is there a way somehow to make this to take more parameters so it suits my needs? So for example
void sig_handler(char* surname, int age);
This is my code:
void sig_handler(int sig) {
printf("SIGINT(%d) received\n", sig);
}
int main( ){
struct sigaction act;
act.sa_handler=sig_handler;
sigaction(SIGINT, &act, NULL);
while(1){};
return 0 ;
}
Not directly, but you could set a global variable that tells your
sig_handler()what to do.