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