mman-map-flags-generic.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* Definitions for POSIX memory map interface. Linux/generic version.
  17. Copyright (C) 1997-2026 Free Software Foundation, Inc.
  18. This file is part of the GNU C Library.
  19. The GNU C Library is free software; you can redistribute it and/or
  20. modify it under the terms of the GNU Lesser General Public
  21. License as published by the Free Software Foundation; either
  22. version 2.1 of the License, or (at your option) any later version.
  23. The GNU C Library is distributed in the hope that it will be useful,
  24. but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. Lesser General Public License for more details.
  27. You should have received a copy of the GNU Lesser General Public
  28. License along with the GNU C Library. If not, see
  29. <https://www.gnu.org/licenses/>. */
  30. #ifndef _SYS_MMAN_H
  31. # error "Never use <bits/mman-map-flags-generic.h> directly; include <sys/mman.h> instead."
  32. #endif
  33. /* These definitions are appropriate for architectures that, in the
  34. Linux kernel, either have no uapi/asm/mman.h, or have one that
  35. includes asm-generic/mman.h without any changes to the values of
  36. the MAP_* flags defined in that header. */
  37. #define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
  38. #define MAP_DENYWRITE 0x00800 /* ETXTBSY. */
  39. #define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
  40. #define MAP_LOCKED 0x02000 /* Lock the mapping. */
  41. #define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
  42. #define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
  43. #define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
  44. #define MAP_STACK 0x20000 /* Allocation is for a stack. */
  45. #define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
  46. #define MAP_SYNC 0x80000 /* Perform synchronous page
  47. faults for the mapping. */
  48. #define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
  49. underlying mapping. */