]>
git.saurik.com Git - apple/libc.git/blob - tests/nxheap.c
eb521e8ee7459e77724aec4a4ebc58dd29e59ac0
10 action(int signo
, struct __siginfo
*info
, void *uap
__attribute__((unused
)))
13 pass
= (signo
== SIGBUS
&& info
->si_addr
== heap
);
15 return siglongjmp(jbuf
, 0);
23 struct sigaction sa
= {
24 .__sigaction_u
.__sa_sigaction
= action
,
25 .sa_flags
= SA_SIGINFO
,
28 test_start("Non-executable heap");
30 ret
= sigaction(SIGBUS
, &sa
, NULL
);
32 test_long("sigaction", ret
, 0);
34 if (sigsetjmp(jbuf
, 0)) {
36 test_long("SIGBUS", 1, 1);
42 test_ptr_notnull("malloc", heap
);
45 ((void (*)(void))heap
)(); // call *%eax
48 test_long("SIGBUS", 0, 1);