4 #include "tests/sys_mman.h"
6 static void handler(int sig
, siginfo_t
*info
, void *v
)
8 printf("info: sig=%d code=%d addr=%p\n",
9 info
->si_signo
, info
->si_code
, info
->si_addr
);
13 /* Blocking a fault, ie SIGSEGV, won't work, and is the same as having
14 the default handler */
17 int* unmapped_page
= get_unmapped_page();
21 sa
.sa_sigaction
= handler
;
22 sigemptyset(&sa
.sa_mask
);
23 sa
.sa_flags
= SA_SIGINFO
;
25 sigaction(SIGSEGV
, &sa
, NULL
);
28 sigprocmask(SIG_BLOCK
, &mask
, NULL
);
30 *(volatile int *)unmapped_page
= 213;