mman.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * File : mman.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2017/11/30 Bernard The first version.
  23. */
  24. #ifndef _SYS_MMAN_H
  25. #define _SYS_MMAN_H
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #define MAP_FAILED ((void *) -1)
  30. #define MAP_SHARED 0x01
  31. #define MAP_PRIVATE 0x02
  32. #define MAP_TYPE 0x0f
  33. #define MAP_FIXED 0x10
  34. #define MAP_ANON 0x20
  35. #define MAP_ANONYMOUS MAP_ANON
  36. #define MAP_NORESERVE 0x4000
  37. #define MAP_GROWSDOWN 0x0100
  38. #define MAP_DENYWRITE 0x0800
  39. #define MAP_EXECUTABLE 0x1000
  40. #define MAP_LOCKED 0x2000
  41. #define MAP_POPULATE 0x8000
  42. #define MAP_NONBLOCK 0x10000
  43. #define MAP_STACK 0x20000
  44. #define MAP_HUGETLB 0x40000
  45. #define MAP_FILE 0
  46. #define PROT_NONE 0
  47. #define PROT_READ 1
  48. #define PROT_WRITE 2
  49. #define PROT_EXEC 4
  50. #define PROT_GROWSDOWN 0x01000000
  51. #define PROT_GROWSUP 0x02000000
  52. #define MS_ASYNC 1
  53. #define MS_INVALIDATE 2
  54. #define MS_SYNC 4
  55. #define MCL_CURRENT 1
  56. #define MCL_FUTURE 2
  57. #define MCL_ONFAULT 4
  58. void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off);
  59. int munmap (void *start, size_t len);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif