A
Alexandre
hello,
in sigaction manpage it's written :
sa_sigaction also specifies the action to be associated with signum.
This function receives the signal number as its first argument, a
pointer to a siginfo_t as its second argument and a pointer to a ucon-
text_t (cast to void *) as its third argument.
so we can pass arguments to the signal handler (throught "void*"), but I
can't find the way...
no way to put it anywhere...
example :
void ping(int sig, siginfo_t *siginf, void *ptr)
{
....
}
int main()
{
struct sigaction sa_ping;
int foo;
foo = 3;
sa_ping.sa_sigaction = ping;
sigemptyset(&sa_ping.sa_mask);
sa_ping.sa_flags = 0;
sigaction(SIGUSR1, &sa_ping, 0);
....
}
where I can pass foo value in argument in ping (with a cast in (int *) )???
if someone has an idea, I'll be thankfull
Alexandre
in sigaction manpage it's written :
sa_sigaction also specifies the action to be associated with signum.
This function receives the signal number as its first argument, a
pointer to a siginfo_t as its second argument and a pointer to a ucon-
text_t (cast to void *) as its third argument.
so we can pass arguments to the signal handler (throught "void*"), but I
can't find the way...
no way to put it anywhere...
example :
void ping(int sig, siginfo_t *siginf, void *ptr)
{
....
}
int main()
{
struct sigaction sa_ping;
int foo;
foo = 3;
sa_ping.sa_sigaction = ping;
sigemptyset(&sa_ping.sa_mask);
sa_ping.sa_flags = 0;
sigaction(SIGUSR1, &sa_ping, 0);
....
}
where I can pass foo value in argument in ping (with a cast in (int *) )???
if someone has an idea, I'll be thankfull
Alexandre