sigaltstck: add missing include
[libc-test.git] / src / api / sys_mman.c
blob62b17229284359c70454e881be9c5eb09835b72d
1 #include <sys/mman.h>
2 #include "options.h"
3 #define T(t) (t*)0;
4 #define F(t,n) {t *y = &x.n;}
5 #define C(n) switch(n){case n:;}
6 static void f()
8 T(mode_t)
9 T(off_t)
10 T(size_t)
12 C(PROT_EXEC)
13 C(PROT_NONE)
14 C(PROT_READ)
15 C(PROT_WRITE)
16 C(MAP_FIXED)
17 C(MAP_PRIVATE)
18 C(MAP_SHARED)
19 #ifdef _XOPEN_SOURCE
20 C(MS_ASYNC)
21 C(MS_INVALIDATE)
22 C(MS_SYNC)
23 #endif
24 C(MCL_CURRENT)
25 C(MCL_FUTURE)
26 {void *x = MAP_FAILED;}
27 C(POSIX_MADV_DONTNEED)
28 C(POSIX_MADV_NORMAL)
29 C(POSIX_MADV_RANDOM)
30 C(POSIX_MADV_SEQUENTIAL)
31 C(POSIX_MADV_WILLNEED)
33 #ifdef POSIX_TYPED_MEMORY_OBJECTS
34 C(POSIX_TYPED_MEM_ALLOCATE)
35 C(POSIX_TYPED_MEM_ALLOCATE_CONTIG)
36 C(POSIX_TYPED_MEM_MAP_ALLOCATABLE)
38 struct posix_typed_mem_info x;
39 F(size_t,posix_tmi_length)
41 int(*p)(const void*restrict,size_t,off_t*restrict,size_t*restrict,int*restrict) = posix_mem_offset;
42 int(*p)(int,struct posix_typed_mem_info*) = posix_typed_mem_get_info;
43 int(*p)(const char*,int,int) = posix_typed_mem_open;
44 #endif
46 {int(*p)(const void*,size_t) = mlock;}
47 {int(*p)(int) = mlockall;}
48 {void*(*p)(void*,size_t,int,int,int,off_t) = mmap;}
49 {int(*p)(void*,size_t,int) = mprotect;}
50 #ifdef _XOPEN_SOURCE
51 {int(*p)(void*,size_t,int) = msync;}
52 #endif
53 {int(*p)(const void*,size_t) = munlock;}
54 {int(*p)(void) = munlockall;}
55 {int(*p)(void*,size_t) = munmap;}
56 {int(*p)(void*,size_t,int) = posix_madvise;}
57 #ifdef POSIX_SHARED_MEMORY_OBJECTS
58 {int(*p)(const char*,int,mode_t) = shm_open;}
59 {int(*p)(const char*) = shm_unlink;}
60 #endif