linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Custom defined object in a signal handler
@ 2007-03-28 23:54 Sreevathsa
  2007-03-29  0:09 ` Glynn Clements
  0 siblings, 1 reply; 4+ messages in thread
From: Sreevathsa @ 2007-03-28 23:54 UTC (permalink / raw)
  To: linux-c-programming

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-29  3:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-28 23:54 Custom defined object in a signal handler Sreevathsa
2007-03-29  0:09 ` Glynn Clements
2007-03-29  0:22   ` Sreevathsa
2007-03-29  3:21     ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).