posix_opt.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. /* Define POSIX options for Linux.
  17. Copyright (C) 1996-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 License as
  21. published by the Free Software Foundation; either version 2.1 of the
  22. 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; see the file COPYING.LIB. If
  29. not, see <https://www.gnu.org/licenses/>. */
  30. #ifndef _BITS_POSIX_OPT_H
  31. #define _BITS_POSIX_OPT_H 1
  32. /* Job control is supported. */
  33. #define _POSIX_JOB_CONTROL 1
  34. /* Processes have a saved set-user-ID and a saved set-group-ID. */
  35. #define _POSIX_SAVED_IDS 1
  36. /* Priority scheduling is not supported with the correct semantics,
  37. but GNU/Linux applications expect that the corresponding interfaces
  38. are available, even though the semantics do not meet the POSIX
  39. requirements. See glibc bug 14829. */
  40. #define _POSIX_PRIORITY_SCHEDULING 200809L
  41. /* Synchronizing file data is supported. */
  42. #define _POSIX_SYNCHRONIZED_IO 200809L
  43. /* The fsync function is present. */
  44. #define _POSIX_FSYNC 200809L
  45. /* Mapping of files to memory is supported. */
  46. #define _POSIX_MAPPED_FILES 200809L
  47. /* Locking of all memory is supported. */
  48. #define _POSIX_MEMLOCK 200809L
  49. /* Locking of ranges of memory is supported. */
  50. #define _POSIX_MEMLOCK_RANGE 200809L
  51. /* Setting of memory protections is supported. */
  52. #define _POSIX_MEMORY_PROTECTION 200809L
  53. /* Some filesystems allow all users to change file ownership. */
  54. #define _POSIX_CHOWN_RESTRICTED 0
  55. /* `c_cc' member of 'struct termios' structure can be disabled by
  56. using the value _POSIX_VDISABLE. */
  57. #define _POSIX_VDISABLE 0
  58. /* Filenames are not silently truncated. */
  59. #define _POSIX_NO_TRUNC 1
  60. /* X/Open realtime support is available. */
  61. #define _XOPEN_REALTIME 1
  62. /* X/Open thread realtime support is available. */
  63. #define _XOPEN_REALTIME_THREADS 1
  64. /* XPG4.2 shared memory is supported. */
  65. #define _XOPEN_SHM 1
  66. /* Tell we have POSIX threads. */
  67. #define _POSIX_THREADS 200809L
  68. /* We have the reentrant functions described in POSIX. */
  69. #define _POSIX_REENTRANT_FUNCTIONS 1
  70. #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
  71. /* We provide priority scheduling for threads. */
  72. #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
  73. /* We support user-defined stack sizes. */
  74. #define _POSIX_THREAD_ATTR_STACKSIZE 200809L
  75. /* We support user-defined stacks. */
  76. #define _POSIX_THREAD_ATTR_STACKADDR 200809L
  77. /* We support priority inheritance. */
  78. #define _POSIX_THREAD_PRIO_INHERIT 200809L
  79. /* We support priority protection, though only for non-robust
  80. mutexes. */
  81. #define _POSIX_THREAD_PRIO_PROTECT 200809L
  82. #ifdef __USE_XOPEN2K8
  83. /* We support priority inheritance for robust mutexes. */
  84. # define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L
  85. /* We do not support priority protection for robust mutexes. */
  86. # define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1
  87. #endif
  88. /* We support POSIX.1b semaphores. */
  89. #define _POSIX_SEMAPHORES 200809L
  90. /* Real-time signals are supported. */
  91. #define _POSIX_REALTIME_SIGNALS 200809L
  92. /* We support asynchronous I/O. */
  93. #define _POSIX_ASYNCHRONOUS_IO 200809L
  94. #define _POSIX_ASYNC_IO 1
  95. /* Alternative name for Unix98. */
  96. #define _LFS_ASYNCHRONOUS_IO 1
  97. /* Support for prioritization is also available. */
  98. #define _POSIX_PRIORITIZED_IO 200809L
  99. /* The LFS support in asynchronous I/O is also available. */
  100. #define _LFS64_ASYNCHRONOUS_IO 1
  101. /* The rest of the LFS is also available. */
  102. #define _LFS_LARGEFILE 1
  103. #define _LFS64_LARGEFILE 1
  104. #define _LFS64_STDIO 1
  105. /* POSIX shared memory objects are implemented. */
  106. #define _POSIX_SHARED_MEMORY_OBJECTS 200809L
  107. /* CPU-time clocks support needs to be checked at runtime. */
  108. #define _POSIX_CPUTIME 0
  109. /* Clock support in threads must be also checked at runtime. */
  110. #define _POSIX_THREAD_CPUTIME 0
  111. /* GNU libc provides regular expression handling. */
  112. #define _POSIX_REGEXP 1
  113. /* Reader/Writer locks are available. */
  114. #define _POSIX_READER_WRITER_LOCKS 200809L
  115. /* We have a POSIX shell. */
  116. #define _POSIX_SHELL 1
  117. /* We support the Timeouts option. */
  118. #define _POSIX_TIMEOUTS 200809L
  119. /* We support spinlocks. */
  120. #define _POSIX_SPIN_LOCKS 200809L
  121. /* The `spawn' function family is supported. */
  122. #define _POSIX_SPAWN 200809L
  123. /* We have POSIX timers. */
  124. #define _POSIX_TIMERS 200809L
  125. /* The barrier functions are available. */
  126. #define _POSIX_BARRIERS 200809L
  127. /* POSIX message queues are available. */
  128. #define _POSIX_MESSAGE_PASSING 200809L
  129. /* Thread process-shared synchronization is supported. */
  130. #define _POSIX_THREAD_PROCESS_SHARED 200809L
  131. /* The monotonic clock might be available. */
  132. #define _POSIX_MONOTONIC_CLOCK 0
  133. /* The clock selection interfaces are available. */
  134. #define _POSIX_CLOCK_SELECTION 200809L
  135. /* Advisory information interfaces are available. */
  136. #define _POSIX_ADVISORY_INFO 200809L
  137. /* IPv6 support is available. */
  138. #define _POSIX_IPV6 200809L
  139. /* Raw socket support is available. */
  140. #define _POSIX_RAW_SOCKETS 200809L
  141. /* We have at least one terminal. */
  142. #define _POSIX2_CHAR_TERM 200809L
  143. /* Neither process nor thread sporadic server interfaces is available. */
  144. #define _POSIX_SPORADIC_SERVER -1
  145. #define _POSIX_THREAD_SPORADIC_SERVER -1
  146. /* trace.h is not available. */
  147. #define _POSIX_TRACE -1
  148. #define _POSIX_TRACE_EVENT_FILTER -1
  149. #define _POSIX_TRACE_INHERIT -1
  150. #define _POSIX_TRACE_LOG -1
  151. /* Typed memory objects are not available. */
  152. #define _POSIX_TYPED_MEMORY_OBJECTS -1
  153. #endif /* bits/posix_opt.h */