Back to index

glibc  2.9
Functions
exc2signal.c File Reference
#include <hurd.h>
#include <hurd/signal.h>
#include <mach/exception.h>

Go to the source code of this file.

Functions

void _hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)

Function Documentation

void _hurd_exception2signal ( struct hurd_signal_detail detail,
int signo 
)

Definition at line 28 of file exc2signal.c.

{
  detail->error = 0;

  switch (detail->exc)
    {
    default:
      *signo = SIGIOT;
      detail->code = detail->exc;
      break;

    case EXC_BAD_ACCESS:
      if (detail->exc_code == KERN_PROTECTION_FAILURE)
       *signo = SIGSEGV;
      else
       *signo = SIGBUS;
      detail->code = detail->exc_subcode;
      detail->error = detail->exc_code;
      break;

      /* XXX there has got to be something more here */

    case EXC_BAD_INSTRUCTION:
      *signo = SIGILL;
      detail->code = 0;
      break;

    case EXC_ARITHMETIC:
      *signo = SIGFPE;
      detail->code = 0;
      break;

    case EXC_EMULATION:
      *signo = SIGEMT;
      detail->code = 0;
      break;

    case EXC_SOFTWARE:
      *signo = SIGEMT;
      detail->code = 0;
      break;

    case EXC_BREAKPOINT:
      *signo = SIGTRAP;
      detail->code = 0;
    }
}