* sa_sigaction signal handler: third parameter?
@ 2001-09-05 9:58 Orjan Friberg
2001-09-07 1:38 ` Jamie Lokier
0 siblings, 1 reply; 2+ messages in thread
From: Orjan Friberg @ 2001-09-05 9:58 UTC (permalink / raw)
To: linux-kernel; +Cc: orjan.friberg
I'm trying to make life easier for a user-defined SIGSEGV handler, the
sa_sigaction one with 3 parameters. The second parameter, the siginfo_t
* one, is there. Problem is, I would like to pass on additional
information to the signal handler, more specifically information about
whether there was a protection fault, read/write etc. I've looked at
some of the other ports (I'm working on the CRIS port BTW), and for
example the i386 has fields in the task and sigcontext structs to keep
this sort of information.
Question is how to pass this information on to the signal handler.
Looking at the code, it seems the third parameter (void *) is being used
to send a ucontext_t * in (at least) the arm and mips cases. I followed
a lot of threads in the archive, but couldn't find one that adressed
what this third parameter is actually meant to be used for. Obviously,
sending a ucontext would solve my problem, since it contains the
sigcontext struct. Is there a Right Way to do it?
(I'm not subscribed to the list, so please keep me on the CC list.)
--
Orjan Friberg E-mail: orjan.friberg@axis.com
Axis Communications AB Phone: +46 46 272 17 68
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: sa_sigaction signal handler: third parameter?
2001-09-05 9:58 sa_sigaction signal handler: third parameter? Orjan Friberg
@ 2001-09-07 1:38 ` Jamie Lokier
0 siblings, 0 replies; 2+ messages in thread
From: Jamie Lokier @ 2001-09-07 1:38 UTC (permalink / raw)
To: Orjan Friberg; +Cc: linux-kernel
Orjan Friberg wrote:
> I'm trying to make life easier for a user-defined SIGSEGV handler, the
> sa_sigaction one with 3 parameters. The second parameter, the siginfo_t
> * one, is there. Problem is, I would like to pass on additional
> information to the signal handler, more specifically information about
> whether there was a protection fault, read/write etc. I've looked at
> some of the other ports (I'm working on the CRIS port BTW), and for
> example the i386 has fields in the task and sigcontext structs to keep
> this sort of information.
>
> Question is how to pass this information on to the signal handler.
> Looking at the code, it seems the third parameter (void *) is being used
> to send a ucontext_t * in (at least) the arm and mips cases. I followed
> a lot of threads in the archive, but couldn't find one that adressed
> what this third parameter is actually meant to be used for. Obviously,
> sending a ucontext would solve my problem, since it contains the
> sigcontext struct. Is there a Right Way to do it?
Whether or not there was a protection fault is indicated with
SEGV_MAPERR vs. SEGV_ACCERR. Unfortunately, the siginfo_t doesn't have
any place to indicate whether it's a read or a write fault. *How could
they have left that out?*
The Right Way, IMHO, would be to find some acceptable,
standard-compatible way to get the read/write flag into the siginfo_t.
cheers,
-- Jamie
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-07 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-05 9:58 sa_sigaction signal handler: third parameter? Orjan Friberg
2001-09-07 1:38 ` Jamie Lokier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox