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

RE: siginfo_t structure is not filled in the signal handler



I will try with the 2.4 kernel. I'm a little new to this - where can I
get a downloadable the 2.4 kernel image for the M68K ? I've looked at
the debian and linux-68k websites and cannot find any links for
downloading a kernel image. 
I would definitely be interested in knowing the workaround to get the
correct mcontext as that is essential for my application too.

Thanks and Regards,
Harish

-----Original Message-----
From: Richard Zidlicky [mailto:rz@linux-m68k.org] 
Sent: Tuesday, July 06, 2004 5:21 PM
To: Harishchandra Rao Tiruvuri (WT01 - TELECOM & INTER-NETWORKING
SOLUTIONS)
Cc: debian-68k@lists.debian.org
Subject: Re: siginfo_t structure is not filled in the signal handler

On Tue, Jul 06, 2004 at 04:25:03PM +0530, harishchandra.rao@wipro.com
wrote:
> Hello,
> 
>  
> 
>        I am working on a Motorola VME 167 card with a 68040 processor.
> The card is running debian linux 2.2 (kernel 2.2.10). The application
I
> am developing needs to handle signals and needs to know the cause of
the
> signal. For example, if the application executes a divide by zero
> instruction then it should know in the signal handler if this was the
> cause.
> 
> For this the application checks the value of 'siginfo_t->si_code'
passed
> to the signal handler. However, this value seems to always zero. 

Siginfo does not work at all for 2.2 kernels, 2.4 and later should
be fine. I am not sure if si_code is very meaningfull, signr which
is also available to the handler should be preferred where possible.
If you really need to use si_code you probably want to check kernel
source to make sure it does what you think
(me thinks arch/m68k/kernel/traps.c).

>    printf("D0 = %x\n", scp->uc_mcontext.gregs[R_D0]);

note that the definition of uc_mcontext in some versions
of glibc is incompatible to the def the kernel uses.
I have a workaround to get correct mcontext values if
you need it.

Richard



Reply to: