2
Copyright (C) 2008-2009, Parrot Foundation.
16
# define PAGE_SIZE getpagesize()
28
0xB8, 0x01, 0, 0, 0, /* movl $1, %eax */
32
typedef int (*pf)(void);
35
main(int argc, char *argv[])
43
fprintf(stderr, "usage: test 0 | 1\n");
50
p = memalign(PAGE_SIZE, PAGE_SIZE);
51
memcpy(p, code, sizeof (code));
54
rc = mprotect(p, PAGE_SIZE, prot);
57
fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
58
PAGE_SIZE, PAGE_SIZE);
72
* c-file-style: "parrot"
74
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :