1 #ifndef _LIMITS_H 2 #define _LIMITS_H 3 4 #include <features.h> 5 6 #include <bits/alltypes.h> /* __LONG_MAX */ 7 8 /* Support signed or unsigned plain-char */ 9 10 #if '\xff' > 0 11 #define CHAR_MIN 0 12 #define CHAR_MAX 255 13 #else 14 #define CHAR_MIN (-128) 15 #define CHAR_MAX 127 16 #endif 17 18 #define CHAR_BIT 8 19 #define SCHAR_MIN (-128) 20 #define SCHAR_MAX 127 21 #define UCHAR_MAX 255 22 #define SHRT_MIN (-1-0x7fff) 23 #define SHRT_MAX 0x7fff 24 #define USHRT_MAX 0xffff 25 #define INT_MIN (-1-0x7fffffff) 26 #define INT_MAX 0x7fffffff 27 #define UINT_MAX 0xffffffffU 28 #define LONG_MIN (-LONG_MAX-1) 29 #define LONG_MAX __LONG_MAX 30 #define ULONG_MAX (2UL*LONG_MAX+1) 31 #define LLONG_MIN (-LLONG_MAX-1) 32 #define LLONG_MAX 0x7fffffffffffffffLL 33 #define ULLONG_MAX (2ULL*LLONG_MAX+1) 34 35 #define MB_LEN_MAX 4 36 37 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 38 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 39 40 #include <bits/limits.h> 41 42 #define PIPE_BUF 4096 43 #define FILESIZEBITS 64 44 #ifndef NAME_MAX 45 #define NAME_MAX 255 46 #endif 47 #define PATH_MAX 256 48 #define NGROUPS_MAX 32 49 #define ARG_MAX 4096 50 #define IOV_MAX 1024 51 #define SYMLOOP_MAX 40 52 #define WORD_BIT 32 53 #define SSIZE_MAX LONG_MAX 54 #define TZNAME_MAX 6 55 #define TTY_NAME_MAX 32 56 #define HOST_NAME_MAX 255 57 58 #if LONG_MAX == 0x7fffffffL 59 #define LONG_BIT 32 60 #else 61 #define LONG_BIT 64 62 #endif 63 64 /* Implementation choices... */ 65 66 #define PTHREAD_KEYS_MAX 128 67 #define PTHREAD_STACK_MIN 2048 68 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 69 #define SEM_VALUE_MAX 0x7fffffff 70 #define SEM_NSEMS_MAX 256 71 #define DELAYTIMER_MAX 0x7fffffff 72 #define MQ_PRIO_MAX 1 73 #define LOGIN_NAME_MAX 256 74 75 /* Arbitrary numbers... */ 76 77 #define BC_BASE_MAX 99 78 #define BC_DIM_MAX 2048 79 #define BC_SCALE_MAX 99 80 #define BC_STRING_MAX 1000 81 #define CHARCLASS_NAME_MAX 14 82 #define COLL_WEIGHTS_MAX 2 83 #define EXPR_NEST_MAX 32 84 #define LINE_MAX 4096 85 #define RE_DUP_MAX 255 86 87 #define NL_ARGMAX 9 88 #define NL_MSGMAX 32767 89 #define NL_SETMAX 255 90 #define NL_TEXTMAX 2048 91 92 #endif 93 94 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE) 95 96 #ifdef PAGESIZE 97 #define PAGE_SIZE PAGESIZE 98 #endif 99 #define NZERO 20 100 #define NL_LANGMAX 32 101 102 #endif 103 104 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \ 105 || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) 106 107 #define NL_NMAX 16 108 109 #endif 110 111 /* POSIX/SUS requirements follow. These numbers come directly 112 * from SUS and have nothing to do with the host system. */ 113 114 #define _POSIX_AIO_LISTIO_MAX 2 115 #define _POSIX_AIO_MAX 1 116 #define _POSIX_ARG_MAX 4096 117 #define _POSIX_CHILD_MAX 25 118 #define _POSIX_CLOCKRES_MIN 20000000 119 #define _POSIX_DELAYTIMER_MAX 32 120 #define _POSIX_HOST_NAME_MAX 255 121 #define _POSIX_LINK_MAX 8 122 #define _POSIX_LOGIN_NAME_MAX 9 123 #define _POSIX_MAX_CANON 255 124 #define _POSIX_MAX_INPUT 255 125 #define _POSIX_MQ_OPEN_MAX 8 126 #define _POSIX_MQ_PRIO_MAX 32 127 #define _POSIX_NAME_MAX 14 128 #define _POSIX_NGROUPS_MAX 8 129 #define _POSIX_OPEN_MAX 20 130 #define _POSIX_PATH_MAX 256 131 #define _POSIX_PIPE_BUF 512 132 #define _POSIX_RE_DUP_MAX 255 133 #define _POSIX_RTSIG_MAX 8 134 #define _POSIX_SEM_NSEMS_MAX 256 135 #define _POSIX_SEM_VALUE_MAX 32767 136 #define _POSIX_SIGQUEUE_MAX 32 137 #define _POSIX_SSIZE_MAX 32767 138 #define _POSIX_STREAM_MAX 8 139 #define _POSIX_SS_REPL_MAX 4 140 #define _POSIX_SYMLINK_MAX 255 141 #define _POSIX_SYMLOOP_MAX 8 142 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 143 #define _POSIX_THREAD_KEYS_MAX 128 144 #define _POSIX_THREAD_THREADS_MAX 64 145 #define _POSIX_TIMER_MAX 32 146 #define _POSIX_TRACE_EVENT_NAME_MAX 30 147 #define _POSIX_TRACE_NAME_MAX 8 148 #define _POSIX_TRACE_SYS_MAX 8 149 #define _POSIX_TRACE_USER_EVENT_MAX 32 150 #define _POSIX_TTY_NAME_MAX 9 151 #define _POSIX_TZNAME_MAX 6 152 #define _POSIX2_BC_BASE_MAX 99 153 #define _POSIX2_BC_DIM_MAX 2048 154 #define _POSIX2_BC_SCALE_MAX 99 155 #define _POSIX2_BC_STRING_MAX 1000 156 #define _POSIX2_CHARCLASS_NAME_MAX 14 157 #define _POSIX2_COLL_WEIGHTS_MAX 2 158 #define _POSIX2_EXPR_NEST_MAX 32 159 #define _POSIX2_LINE_MAX 2048 160 #define _POSIX2_RE_DUP_MAX 255 161 162 #define _XOPEN_IOV_MAX 16 163 #define _XOPEN_NAME_MAX 255 164 #define _XOPEN_PATH_MAX 1024 165 166 #endif 167