mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
59bf8611c0
git-svn-id: svn://svn.cc65.org/cc65/trunk@2023 b7a2c559-68d2-44c3-8de9-860c34a00d81
30 lines
558 B
C
30 lines
558 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#include <signal.h>
|
|
|
|
|
|
void __fastcall__ sighandler (int sig)
|
|
{
|
|
printf ("Got signal #%d\n", sig);
|
|
}
|
|
|
|
|
|
|
|
int main (void)
|
|
{
|
|
if (signal (SIGSEGV, sighandler) == SIG_ERR) {
|
|
printf ("signal failure %d: %s\n", errno, strerror (errno));
|
|
return 1;
|
|
}
|
|
printf ("About to raise SIGSEGV...\n");
|
|
raise (SIGSEGV);
|
|
printf ("Back from signal handler\n");
|
|
printf ("About to raise SIGILL...\n");
|
|
raise (SIGILL);
|
|
printf ("Back from signal handler\n");
|
|
return 0;
|
|
}
|
|
|
|
|