posix1_lim.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. /* Copyright (C) 1991-2026 Free Software Foundation, Inc.
  17. This file is part of the GNU C Library.
  18. The GNU C Library is free software; you can redistribute it and/or
  19. modify it under the terms of the GNU Lesser General Public
  20. License as published by the Free Software Foundation; either
  21. version 2.1 of the License, or (at your option) any later version.
  22. The GNU C Library is distributed in the hope that it will be useful,
  23. but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  25. Lesser General Public License for more details.
  26. You should have received a copy of the GNU Lesser General Public
  27. License along with the GNU C Library; if not, see
  28. <https://www.gnu.org/licenses/>. */
  29. /*
  30. * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
  31. *
  32. * Never include this file directly; use <limits.h> instead.
  33. */
  34. #ifndef _BITS_POSIX1_LIM_H
  35. #define _BITS_POSIX1_LIM_H 1
  36. #include <bits/wordsize.h>
  37. /* These are the standard-mandated minimum values. */
  38. /* Minimum number of operations in one list I/O call. */
  39. #define _POSIX_AIO_LISTIO_MAX 2
  40. /* Minimal number of outstanding asynchronous I/O operations. */
  41. #define _POSIX_AIO_MAX 1
  42. /* Maximum length of arguments to `execve', including environment. */
  43. #define _POSIX_ARG_MAX 4096
  44. /* Maximum simultaneous processes per real user ID. */
  45. #ifdef __USE_XOPEN2K
  46. # define _POSIX_CHILD_MAX 25
  47. #else
  48. # define _POSIX_CHILD_MAX 6
  49. #endif
  50. /* Minimal number of timer expiration overruns. */
  51. #define _POSIX_DELAYTIMER_MAX 32
  52. /* Maximum length of a host name (not including the terminating null)
  53. as returned from the GETHOSTNAME function. */
  54. #define _POSIX_HOST_NAME_MAX 255
  55. /* Maximum link count of a file. */
  56. #define _POSIX_LINK_MAX 8
  57. /* Maximum length of login name. */
  58. #define _POSIX_LOGIN_NAME_MAX 9
  59. /* Number of bytes in a terminal canonical input queue. */
  60. #define _POSIX_MAX_CANON 255
  61. /* Number of bytes for which space will be
  62. available in a terminal input queue. */
  63. #define _POSIX_MAX_INPUT 255
  64. /* Maximum number of message queues open for a process. */
  65. #define _POSIX_MQ_OPEN_MAX 8
  66. /* Maximum number of supported message priorities. */
  67. #define _POSIX_MQ_PRIO_MAX 32
  68. /* Number of bytes in a filename. */
  69. #define _POSIX_NAME_MAX 14
  70. /* Number of simultaneous supplementary group IDs per process. */
  71. #ifdef __USE_XOPEN2K
  72. # define _POSIX_NGROUPS_MAX 8
  73. #else
  74. # define _POSIX_NGROUPS_MAX 0
  75. #endif
  76. /* Number of files one process can have open at once. */
  77. #ifdef __USE_XOPEN2K
  78. # define _POSIX_OPEN_MAX 20
  79. #else
  80. # define _POSIX_OPEN_MAX 16
  81. #endif
  82. #if !defined __USE_XOPEN2K || defined __USE_GNU
  83. /* Number of descriptors that a process may examine with `pselect' or
  84. `select'. */
  85. # define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
  86. #endif
  87. /* Number of bytes in a pathname. */
  88. #define _POSIX_PATH_MAX 256
  89. /* Number of bytes than can be written atomically to a pipe. */
  90. #define _POSIX_PIPE_BUF 512
  91. /* The number of repeated occurrences of a BRE permitted by the
  92. REGEXEC and REGCOMP functions when using the interval notation. */
  93. #define _POSIX_RE_DUP_MAX 255
  94. /* Minimal number of realtime signals reserved for the application. */
  95. #define _POSIX_RTSIG_MAX 8
  96. /* Number of semaphores a process can have. */
  97. #define _POSIX_SEM_NSEMS_MAX 256
  98. /* Maximal value of a semaphore. */
  99. #define _POSIX_SEM_VALUE_MAX 32767
  100. /* Number of pending realtime signals. */
  101. #define _POSIX_SIGQUEUE_MAX 32
  102. /* Largest value of a `ssize_t'. */
  103. #define _POSIX_SSIZE_MAX 32767
  104. /* Number of streams a process can have open at once. */
  105. #define _POSIX_STREAM_MAX 8
  106. /* The number of bytes in a symbolic link. */
  107. #define _POSIX_SYMLINK_MAX 255
  108. /* The number of symbolic links that can be traversed in the
  109. resolution of a pathname in the absence of a loop. */
  110. #define _POSIX_SYMLOOP_MAX 8
  111. /* Number of timer for a process. */
  112. #define _POSIX_TIMER_MAX 32
  113. /* Maximum number of characters in a tty name. */
  114. #define _POSIX_TTY_NAME_MAX 9
  115. /* Maximum length of a time zone abbreviation (element of 'tzname'). */
  116. #ifdef __USE_XOPEN2K
  117. # define _POSIX_TZNAME_MAX 6
  118. #else
  119. # define _POSIX_TZNAME_MAX 3
  120. #endif
  121. #if !defined __USE_XOPEN2K || defined __USE_GNU
  122. /* Maximum number of connections that can be queued on a socket. */
  123. # define _POSIX_QLIMIT 1
  124. /* Maximum number of bytes that can be buffered on a socket for send
  125. or receive. */
  126. # define _POSIX_HIWAT _POSIX_PIPE_BUF
  127. /* Maximum number of elements in an `iovec' array. */
  128. # define _POSIX_UIO_MAXIOV 16
  129. #endif
  130. /* Maximum clock resolution in nanoseconds. */
  131. #define _POSIX_CLOCKRES_MIN 20000000
  132. /* Get the implementation-specific values for the above. */
  133. #include <bits/local_lim.h>
  134. #ifndef SSIZE_MAX
  135. /* ssize_t is not formally required to be the signed type
  136. corresponding to size_t, but it is for all configurations supported
  137. by glibc. */
  138. # if __WORDSIZE == 64 || __WORDSIZE32_SIZE_ULONG
  139. # define SSIZE_MAX LONG_MAX
  140. # else
  141. # define SSIZE_MAX INT_MAX
  142. # endif
  143. #endif
  144. /* This value is a guaranteed minimum maximum.
  145. The current maximum can be got from `sysconf'. */
  146. #ifndef NGROUPS_MAX
  147. # define NGROUPS_MAX 8
  148. #endif
  149. #endif /* bits/posix1_lim.h */