From: "Sreevathsa" <sreevathsa@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Custom defined object in a signal handler
Date: Wed, 28 Mar 2007 16:54:02 -0700 [thread overview]
Message-ID: <460b0048.12917d31.29d5.102f@mx.google.com> (raw)
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
next reply other threads:[~2007-03-28 23:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 23:54 Sreevathsa [this message]
2007-03-29 0:09 ` Custom defined object in a signal handler Glynn Clements
2007-03-29 0:22 ` Sreevathsa
2007-03-29 3:21 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=460b0048.12917d31.29d5.102f@mx.google.com \
--to=sreevathsa@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).