mman.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #ifndef _SYS_MMAN_H
  11. #define _SYS_MMAN_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define MAP_FAILED ((void *) -1)
  16. #define MAP_SHARED 0x01
  17. #define MAP_PRIVATE 0x02
  18. #define MAP_TYPE 0x0f
  19. #define MAP_FIXED 0x10
  20. #define MAP_ANON 0x20
  21. #define MAP_ANONYMOUS MAP_ANON
  22. #define MAP_NORESERVE 0x4000
  23. #define MAP_GROWSDOWN 0x0100
  24. #define MAP_DENYWRITE 0x0800
  25. #define MAP_EXECUTABLE 0x1000
  26. #define MAP_LOCKED 0x2000
  27. #define MAP_POPULATE 0x8000
  28. #define MAP_NONBLOCK 0x10000
  29. #define MAP_STACK 0x20000
  30. #define MAP_HUGETLB 0x40000
  31. #define MAP_FILE 0
  32. #define PROT_NONE 0
  33. #define PROT_READ 1
  34. #define PROT_WRITE 2
  35. #define PROT_EXEC 4
  36. #define PROT_GROWSDOWN 0x01000000
  37. #define PROT_GROWSUP 0x02000000
  38. #define MS_ASYNC 1
  39. #define MS_INVALIDATE 2
  40. #define MS_SYNC 4
  41. #define MCL_CURRENT 1
  42. #define MCL_FUTURE 2
  43. #define MCL_ONFAULT 4
  44. void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off);
  45. int munmap (void *start, size_t len);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif