3

I am porting a code from IRIX to Linux RedHat, that is currently using signal handlers with the form of

void sig_handler (int sig, int code, struct sigcontext *).

These codes are for example BRK_USERBP, BRK_SSTEPBP, BRK_OVERFLOW, BRK_DIVZERO and BRK_MULOVF.

My searches have shown that Linux doesn't support it. Does it?

If not, what equivalent/replacement can I use instead?

I have seen si_code in siginfo_t in sigaction, but it doesn't seem right for this purpose.

Thanks!

Marc B
  • 356,200
  • 43
  • 426
  • 500
avish12
  • 107
  • 8
  • from reading the manpage, si_code seems to do exactly what you're looking for. e.g.: *The following values can be placed in si_code for a SIGTRAP signal: ``TRAP_BRKPT``: process breakpoint […]* – Jonas Schäfer Feb 15 '13 at 14:44
  • Thanks. But it seems a bit lack of compatibility... now _BRK_USERBP_ and _BRK_SSTEPBP_ will be the same (_TRAP_BRKPT_, as you said), and didn't find any equivalent for _BRK_MULOVF_. – avish12 Feb 15 '13 at 14:49
  • Is mulovf a multiplication overflow? If so, thats probably handled by SIGFPE or something. – Jonas Schäfer Feb 15 '13 at 15:11
  • Most important question, what are those signals supposed to do in the code you are porting? SIGFPE is a signal bucket that handles most FPU faults. – Stian Skjelstad Apr 19 '16 at 11:18

0 Answers0