Blame src/api/sys_mman.c

nsz f81126
#include <sys/mman.h>
Szabolcs Nagy 87b251
#include "options.h"
nsz f81126
#define T(t) (t*)0;
nsz f81126
#define F(t,n) {t *y = &x.;;}
nsz f81126
#define C(n) switch(n){case n:;}
nsz f81126
static void f()
nsz f81126
{
nsz f81126
T(mode_t)
nsz f81126
T(off_t)
nsz f81126
T(size_t)
nsz 3c60f4
nsz f81126
C(PROT_EXEC)
nsz f81126
C(PROT_NONE)
nsz f81126
C(PROT_READ)
nsz f81126
C(PROT_WRITE)
nsz f81126
C(MAP_FIXED)
nsz f81126
C(MAP_PRIVATE)
nsz f81126
C(MAP_SHARED)
nsz f81126
#ifdef _XOPEN_SOURCE
nsz f81126
C(MS_ASYNC)
nsz f81126
C(MS_INVALIDATE)
nsz f81126
C(MS_SYNC)
nsz f81126
#endif
nsz f81126
C(MCL_CURRENT)
nsz f81126
C(MCL_FUTURE)
nsz f81126
{void *x = MAP_FAILED;}
nsz f81126
C(POSIX_MADV_DONTNEED)
nsz f81126
C(POSIX_MADV_NORMAL)
nsz f81126
C(POSIX_MADV_RANDOM)
nsz f81126
C(POSIX_MADV_SEQUENTIAL)
nsz f81126
C(POSIX_MADV_WILLNEED)
nsz 3c60f4
Szabolcs Nagy 87b251
#ifdef POSIX_TYPED_MEMORY_OBJECTS
nsz 3c60f4
C(POSIX_TYPED_MEM_ALLOCATE)
nsz 3c60f4
C(POSIX_TYPED_MEM_ALLOCATE_CONTIG)
nsz 3c60f4
C(POSIX_TYPED_MEM_MAP_ALLOCATABLE)
nsz 3c60f4
{
nsz 3c60f4
struct posix_typed_mem_info x;
nsz 3c60f4
F(size_t,posix_tmi_length)
nsz 3c60f4
}
nsz 3c60f4
int(*p)(const void*restrict,size_t,off_t*restrict,size_t*restrict,int*restrict) = posix_mem_offset;
nsz 3c60f4
int(*p)(int,struct posix_typed_mem_info*) = posix_typed_mem_get_info;
nsz 3c60f4
int(*p)(const char*,int,int) = posix_typed_mem_open;
nsz 3c60f4
#endif
nsz 3c60f4
nsz 0ef264
{int(*p)(const void*,size_t) = mlock;}
nsz 0ef264
{int(*p)(int) = mlockall;}
nsz 0ef264
{void*(*p)(void*,size_t,int,int,int,off_t) = mmap;}
nsz 0ef264
{int(*p)(void*,size_t,int) = mprotect;}
nsz f81126
#ifdef _XOPEN_SOURCE
nsz 0ef264
{int(*p)(void*,size_t,int) = msync;}
nsz f81126
#endif
nsz 0ef264
{int(*p)(const void*,size_t) = munlock;}
nsz 0ef264
{int(*p)(void) = munlockall;}
nsz 0ef264
{int(*p)(void*,size_t) = munmap;}
nsz 0ef264
{int(*p)(void*,size_t,int) = posix_madvise;}
Szabolcs Nagy 87b251
#ifdef POSIX_SHARED_MEMORY_OBJECTS
nsz 0ef264
{int(*p)(const char*,int,mode_t) = shm_open;}
nsz 0ef264
{int(*p)(const char*) = shm_unlink;}
Szabolcs Nagy 87b251
#endif
nsz f81126
}