limits.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <bits/stdint.h>
  8. #include <bits/wchar.h>
  9. #ifndef PAGE_SIZE
  10. # define PAGE_SIZE 4096
  11. #endif
  12. #define HOST_NAME_MAX 64
  13. #define PATH_MAX 4096
  14. #if !defined MAXPATHLEN && defined PATH_MAX
  15. # define MAXPATHLEN PATH_MAX
  16. #endif
  17. #define NAME_MAX 255
  18. #define TTY_NAME_MAX 32
  19. #define PIPE_BUF 4096
  20. #define INT_MAX INT32_MAX
  21. #define INT_MIN INT32_MIN
  22. #define UINT_MAX UINT32_MAX
  23. #define CHAR_BIT 8
  24. #define SCHAR_MIN (-128)
  25. #define SCHAR_MAX 127
  26. #define UCHAR_MAX 255
  27. #define SHRT_MAX 32768
  28. #define SHRT_MIN (-SHRT_MAX - 1)
  29. #define USHRT_MAX 65535
  30. #ifdef __x86_64__
  31. # define LONG_MAX 9223372036854775807L
  32. #else
  33. # define LONG_MAX 2147483647L
  34. #endif
  35. #define LONG_MIN (-LONG_MAX - 1L)
  36. #ifdef __x86_64__
  37. # define ULONG_MAX 18446744073709551615UL
  38. #else
  39. # define ULONG_MAX 4294967295UL
  40. #endif
  41. #define LONG_LONG_MAX 9223372036854775807LL
  42. #define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
  43. #define LLONG_MAX LONG_LONG_MAX
  44. #define LLONG_MIN LONG_LONG_MIN
  45. #define ULONG_LONG_MAX 18446744073709551615ULL
  46. #define ULLONG_MAX ULONG_LONG_MAX
  47. #define CHAR_MIN SCHAR_MIN
  48. #define CHAR_MAX SCHAR_MAX
  49. #define CHAR_WIDTH 8
  50. #define SCHAR_WIDTH 8
  51. #define UCHAR_WIDTH 8
  52. #define SHRT_WIDTH 16
  53. #define USHRT_WIDTH 16
  54. #define INT_WIDTH 32
  55. #define UINT_WIDTH 32
  56. #define LONG_WIDTH 32
  57. #define ULONG_WIDTH 32
  58. #define LLONG_WIDTH 64
  59. #define ULLONG_WIDTH 64
  60. #define ARG_MAX 65536
  61. #define PTHREAD_STACK_MIN 65536
  62. #define SSIZE_MAX 2147483647
  63. #define LINK_MAX 4096
  64. #define TZNAME_MAX 64
  65. #ifdef __USE_POSIX
  66. # include <bits/posix1_lim.h>
  67. #endif