Custom defined object in a signal handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a question regarding signals. Is there a way you can pass some custom
defined parameter (say, a struct foo * ) to a signal handler??

To be more specific, struct sigaction defines 2 types of handlers - namely
sa_handler and sa_sigaction both of which have predefined set of arguments
to them.

sa_handler has (int) as the argument and sa_sigaction has (int, siginfo_t *,
void *) as its arguments. The third argument void * to sa_sigaction is for a
ucontext_t struct that contains the process's context at the time of signal
delivery.

My requirement is: I need to pass a struct foo * pointer to the signal
handler when I set it up and later when the signal is delivered I must be
able to see the foo * that I had passed at the time of setting up the
handler. Does anyone know how we can do this?

TIA,
Sreevathsa

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux