xopen_lim.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* Copyright (C) 1996-2021 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. /*
  15. * Never include this file directly; use <limits.h> instead.
  16. */
  17. /* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
  18. System Interfaces and Headers, 4.16 <limits.h>
  19. Please note only the values which are not greater than the minimum
  20. stated in the standard document are listed. The `sysconf' functions
  21. should be used to obtain the actual value. */
  22. #ifndef _XOPEN_LIM_H
  23. #define _XOPEN_LIM_H 1
  24. /* We do not provide fixed values for
  25. ARG_MAX Maximum length of argument to the `exec' function
  26. including environment data.
  27. ATEXIT_MAX Maximum number of functions that may be registered
  28. with `atexit'.
  29. CHILD_MAX Maximum number of simultaneous processes per real
  30. user ID.
  31. OPEN_MAX Maximum number of files that one process can have open
  32. at anyone time.
  33. PAGESIZE
  34. PAGE_SIZE Size of bytes of a page.
  35. PASS_MAX Maximum number of significant bytes in a password.
  36. We only provide a fixed limit for
  37. IOV_MAX Maximum number of `iovec' structures that one process has
  38. available for use with `readv' or writev'.
  39. if this is indeed fixed by the underlying system.
  40. */
  41. /* Maximum number of `iovec' structures that may be used in a single call
  42. to `readv', `writev', etc. */
  43. #define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
  44. #include <bits/uio_lim.h>
  45. #ifdef __IOV_MAX
  46. # define IOV_MAX __IOV_MAX
  47. #else
  48. # undef IOV_MAX
  49. #endif
  50. /* Maximum value of `digit' in calls to the `printf' and `scanf'
  51. functions. We have no limit, so return a reasonable value. */
  52. #define NL_ARGMAX _POSIX_ARG_MAX
  53. /* Maximum number of bytes in a `LANG' name. We have no limit. */
  54. #define NL_LANGMAX _POSIX2_LINE_MAX
  55. /* Maximum message number. We have no limit. */
  56. #define NL_MSGMAX INT_MAX
  57. /* Maximum number of bytes in N-to-1 collation mapping. We have no
  58. limit. */
  59. #if defined __USE_GNU || !defined __USE_XOPEN2K8
  60. # define NL_NMAX INT_MAX
  61. #endif
  62. /* Maximum set number. We have no limit. */
  63. #define NL_SETMAX INT_MAX
  64. /* Maximum number of bytes in a message. We have no limit. */
  65. #define NL_TEXTMAX INT_MAX
  66. /* Default process priority. */
  67. #define NZERO 20
  68. /* Number of bits in a word of type `int'. */
  69. #ifdef INT_MAX
  70. # if INT_MAX == 32767
  71. # define WORD_BIT 16
  72. # else
  73. # if INT_MAX == 2147483647
  74. # define WORD_BIT 32
  75. # else
  76. /* Safe assumption. */
  77. # define WORD_BIT 64
  78. # endif
  79. # endif
  80. #elif defined __INT_MAX__
  81. # if __INT_MAX__ == 32767
  82. # define WORD_BIT 16
  83. # else
  84. # if __INT_MAX__ == 2147483647
  85. # define WORD_BIT 32
  86. # else
  87. /* Safe assumption. */
  88. # define WORD_BIT 64
  89. # endif
  90. # endif
  91. #else
  92. # define WORD_BIT 32
  93. #endif
  94. /* Number of bits in a word of type `long int'. */
  95. #ifdef LONG_MAX
  96. # if LONG_MAX == 2147483647
  97. # define LONG_BIT 32
  98. # else
  99. /* Safe assumption. */
  100. # define LONG_BIT 64
  101. # endif
  102. #elif defined __LONG_MAX__
  103. # if __LONG_MAX__ == 2147483647
  104. # define LONG_BIT 32
  105. # else
  106. /* Safe assumption. */
  107. # define LONG_BIT 64
  108. # endif
  109. #else
  110. # include <bits/wordsize.h>
  111. # if __WORDSIZE == 64
  112. # define LONG_BIT 64
  113. # else
  114. # define LONG_BIT 32
  115. # endif
  116. #endif
  117. #endif /* bits/xopen_lim.h */