1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2017/11/30 Bernard The first version. 9 */ 10 11 #ifndef _SYS_MMAN_H 12 #define _SYS_MMAN_H 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 #define MAP_FAILED ((void *) -1) 19 20 #define MAP_SHARED 0x01 21 #define MAP_PRIVATE 0x02 22 #define MAP_TYPE 0x0f 23 #define MAP_FIXED 0x10 24 #define MAP_ANON 0x20 25 #define MAP_ANONYMOUS MAP_ANON 26 #define MAP_NORESERVE 0x4000 27 #define MAP_GROWSDOWN 0x0100 28 #define MAP_DENYWRITE 0x0800 29 #define MAP_EXECUTABLE 0x1000 30 #define MAP_LOCKED 0x2000 31 #define MAP_POPULATE 0x8000 32 #define MAP_NONBLOCK 0x10000 33 #define MAP_STACK 0x20000 34 #define MAP_HUGETLB 0x40000 35 #define MAP_FILE 0 36 37 #define PROT_NONE 0 38 #define PROT_READ 1 39 #define PROT_WRITE 2 40 #define PROT_EXEC 4 41 #define PROT_GROWSDOWN 0x01000000 42 #define PROT_GROWSUP 0x02000000 43 44 #define MS_ASYNC 1 45 #define MS_INVALIDATE 2 46 #define MS_SYNC 4 47 48 #define MCL_CURRENT 1 49 #define MCL_FUTURE 2 50 #define MCL_ONFAULT 4 51 52 void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off); 53 int munmap (void *start, size_t len); 54 55 #ifdef __cplusplus 56 } 57 #endif 58 #endif 59