9 # define PAGE_SIZE getpagesize()
12 /* test for exec privs */
22 0xB8,0x01,0,0,0, /* movl $1, %eax */
26 typedef int (*pf)(void);
28 int main(int argc, char *argv[])
36 fprintf(stderr, "usage: test 0 | 1\n");
43 p = memalign(PAGE_SIZE, sizeof(code));
44 memcpy(p, code, sizeof(code));
47 rc = mprotect(p, PAGE_SIZE, prot);
50 fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
51 PAGE_SIZE, PAGE_SIZE);