-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.c
109 lines (109 loc) · 2.61 KB
/
constants.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include <sys/mman.h>
#include <stdio.h>
int
main(void)
{
printf("structure Constants = struct\n");
printf("\tval PROT_EXEC = 0x%X\n", PROT_EXEC); /* POSIX */
printf("\tval PROT_READ = 0x%X\n", PROT_READ); /* POSIX */
printf("\tval PROT_WRITE = 0x%X\n", PROT_WRITE); /* POSIX */
printf("\tval PROT_NONE = 0x%X\n", PROT_NONE); /* POSIX */
printf("\tval MAP_SHARED = 0x%X\n", MAP_SHARED); /* POSIX */
printf("\tval MAP_PRIVATE = 0x%X\n", MAP_PRIVATE); /* POSIX */
printf("\tval MAP_32BIT = ");
# ifdef MAP_32BIT
printf("0x%X\n", MAP_32BIT); /* Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_ALIGN = ");
# ifdef MAP_ALIGN
printf("0x%X\n", MAP_ALIGN); /* Solaris */
# else
printf("0\n");
# endif
printf("\tval MAP_ANONYMOUS = ");
# ifdef MAP_ANONYMOUS
printf("0x%X\n", MAP_ANONYMOUS); /* Linux */
# else
# ifdef MAP_ANON
printf("0x%X\n", MAP_ANON); /* FreeBSD, OSX */
# else
printf("0\n");
# endif
# endif
printf("\tval MAP_FIXED = 0x%X\n", MAP_FIXED); /* POSIX */
printf("\tval MAP_GROWSDOWN = ");
# ifdef MAP_GROWSDOWN
printf("0x%X\n", MAP_GROWSDOWN); /* Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_HASSEMAPHORE = ");
# ifdef MAP_HASSEMAPHORE
printf("0x%X\n", MAP_HASSEMAPHORE); /* FreeBSD, OSX */
# else
printf("0\n");
# endif
printf("\tval MAP_HUGETLB = ");
# ifdef MAP_HUGETLB
printf("0x%X\n", MAP_HUGETLB); /* Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_INITDATA = ");
# ifdef MAP_INITDATA
printf("0x%X\n", MAP_INITDATA); /* Solaris */
# else
printf("0\n");
# endif
printf("\tval MAP_LOCKED = ");
# ifdef MAP_LOCKED
printf("0x%X\n", MAP_LOCKED); /* Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_NOCACHE = ");
# ifdef MAP_NOCACHE
printf("0x%X\n", MAP_NOCACHE); /* OSX */
# else
printf("0\n");
# endif
printf("\tval MAP_NONBLOCK = "); /* Linux */
# ifdef MAP_NONBLOCK
printf("0x%X\n", MAP_NONBLOCK);
# else
printf("0\n");
# endif
printf("\tval MAP_NORESERVE = ");
# ifdef MAP_NORESERVE
printf("0x%X\n", MAP_NORESERVE); /* Linux, Solaris */
# else
printf("0\n");
# endif
printf("\tval MAP_POPULATE = ");
# ifdef MAP_POPULATE
printf("0x%X\n", MAP_POPULATE); /* Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_STACK = ");
# ifdef MAP_STACK
printf("0x%X\n", MAP_STACK); /* FreeBSD, Linux */
# else
printf("0\n");
# endif
printf("\tval MAP_TEXT = ");
# ifdef MAP_TEXT
printf("0x%X\n", MAP_TEXT); /* Solaris */
# else
printf("0\n");
# endif
printf("\tval MAP_UNINITIALIZED = ");
# ifdef MAP_UNINITIALIZED
printf("0x%X\n", MAP_UNINITIALIZED); /* Linux */
# else
printf("0\n");
# endif
printf("end\n");
}