7029 want per-process exploit mitigation features (secflags)
[unleashed.git] / usr / src / test / os-tests / tests / secflags / addrs.c
blob02677f206d71905f1d04521356c2db27f8e24f38
1 #include <sys/mman.h>
3 #include <stdlib.h>
4 #include <unistd.h>
5 #include <err.h>
7 int
8 main(int argc, char **argv)
10 int stack = 0;
11 void *heap = NULL;
12 void *mapping = NULL;
14 if ((heap = malloc(10)) == NULL)
15 err(1, "couldn't allocate");
17 if ((mapping = mmap((caddr_t)0, 10, (PROT_READ | PROT_WRITE),
18 MAP_ANON|MAP_PRIVATE, -1, 0)) == (void*)-1)
19 err(1, "couldn't map");
21 printf(" stack: 0x%p\n", &stack);
22 printf(" heap: 0x%p\n", heap);
23 printf("mapping: 0x%p\n", mapping);
24 printf(" text: 0x%p\n", &main);
25 return (0);