local_lim.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. /* Minimum guaranteed maximum values for system limits. Linux version.
  17. Copyright (C) 1993-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. /* The kernel header pollutes the namespace with the NR_OPEN symbol
  31. and defines LINK_MAX although filesystems have different maxima. A
  32. similar thing is true for OPEN_MAX: the limit can be changed at
  33. runtime and therefore the macro must not be defined. Remove this
  34. after including the header if necessary. */
  35. #ifndef NR_OPEN
  36. # define __undef_NR_OPEN
  37. #endif
  38. #ifndef LINK_MAX
  39. # define __undef_LINK_MAX
  40. #endif
  41. #ifndef OPEN_MAX
  42. # define __undef_OPEN_MAX
  43. #endif
  44. #ifndef ARG_MAX
  45. # define __undef_ARG_MAX
  46. #endif
  47. /* The kernel sources contain a file with all the needed information. */
  48. #include <linux/limits.h>
  49. /* Have to remove NR_OPEN? */
  50. #ifdef __undef_NR_OPEN
  51. # undef NR_OPEN
  52. # undef __undef_NR_OPEN
  53. #endif
  54. /* Have to remove LINK_MAX? */
  55. #ifdef __undef_LINK_MAX
  56. # undef LINK_MAX
  57. # undef __undef_LINK_MAX
  58. #endif
  59. /* Have to remove OPEN_MAX? */
  60. #ifdef __undef_OPEN_MAX
  61. # undef OPEN_MAX
  62. # undef __undef_OPEN_MAX
  63. #endif
  64. /* Have to remove ARG_MAX? */
  65. #ifdef __undef_ARG_MAX
  66. # undef ARG_MAX
  67. # undef __undef_ARG_MAX
  68. #endif
  69. /* The number of data keys per process. */
  70. #define _POSIX_THREAD_KEYS_MAX 128
  71. /* This is the value this implementation supports. */
  72. #define PTHREAD_KEYS_MAX 1024
  73. /* Controlling the iterations of destructors for thread-specific data. */
  74. #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
  75. /* Number of iterations this implementation does. */
  76. #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
  77. /* The number of threads per process. */
  78. #define _POSIX_THREAD_THREADS_MAX 64
  79. /* We have no predefined limit on the number of threads. */
  80. #undef PTHREAD_THREADS_MAX
  81. /* Maximum amount by which a process can decrease its asynchronous I/O
  82. priority level. */
  83. #define AIO_PRIO_DELTA_MAX 20
  84. /* Arrange for the definition of PTHREAD_STACK_MIN. */
  85. #include <bits/pthread_stack_min-dynamic.h>
  86. /* Maximum number of timer expiration overruns. */
  87. #define DELAYTIMER_MAX 2147483647
  88. /* Maximum tty name length. */
  89. #define TTY_NAME_MAX 32
  90. /* Maximum login name length. This is arbitrary. */
  91. #define LOGIN_NAME_MAX 256
  92. /* Maximum host name length. */
  93. #define HOST_NAME_MAX 64
  94. /* Maximum message queue priority level. */
  95. #define MQ_PRIO_MAX 32768
  96. /* Maximum value the semaphore can have. */
  97. #define SEM_VALUE_MAX (2147483647)