Currently, I am writing a signal handler for ARM to provide as much debug information as I can. For testing purposes, I cause different calamities. The signal I receive isSIGFPE
, as expected, but the si_code differs from what I expected. I am wondering, why the si_code for integer division with zero is set to SI_TKILL
instead of FPE_INTDIV
or any other SIGFPE
si_code on ARM.
The following function is used to cause the error:
int divide_by_zero()
{
int c = 1;
int b = 0;
return c / b;
}
Is this the default behavior? Are the si_codes on ARM reduced?
I use the arm-linux-gcc compiler for the target which is provided by Buildroot.