1 | /* getconf.h -- replacement definitions for ones the system doesn't provide. */
|
---|
2 |
|
---|
3 | #ifndef _GETCONF_H
|
---|
4 | #define _GETCONF_H
|
---|
5 |
|
---|
6 | /* Some systems do not define these; use POSIX.2 minimum recommended values. */
|
---|
7 | #ifndef _POSIX2_COLL_WEIGHTS_MAX
|
---|
8 | # define _POSIX2_COLL_WEIGHTS_MAX 2
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | /* If we're on a posix system, but the system doesn't define the necessary
|
---|
12 | constants, use posix.1 minimum values. */
|
---|
13 | #if defined (_POSIX_VERSION)
|
---|
14 |
|
---|
15 | #ifndef _POSIX_ARG_MAX
|
---|
16 | # define _POSIX_ARG_MAX 4096
|
---|
17 | #endif
|
---|
18 | #ifndef _POSIX_CHILD_MAX
|
---|
19 | # define _POSIX_CHILD_MAX 6
|
---|
20 | #endif
|
---|
21 | #ifndef _POSIX_LINK_MAX
|
---|
22 | # define _POSIX_LINK_MAX 8
|
---|
23 | #endif
|
---|
24 | #ifndef _POSIX_MAX_CANON
|
---|
25 | # define _POSIX_MAX_CANON 255
|
---|
26 | #endif
|
---|
27 | #ifndef _POSIX_MAX_INPUT
|
---|
28 | # define _POSIX_MAX_INPUT 255
|
---|
29 | #endif
|
---|
30 | #ifndef _POSIX_NAME_MAX
|
---|
31 | # define _POSIX_NAME_MAX 14
|
---|
32 | #endif
|
---|
33 | #ifndef _POSIX_NGROUPS_MAX
|
---|
34 | # define _POSIX_NGROUPS_MAX 0
|
---|
35 | #endif
|
---|
36 | #ifndef _POSIX_OPEN_MAX
|
---|
37 | # define _POSIX_OPEN_MAX 16
|
---|
38 | #endif
|
---|
39 | #ifndef _POSIX_PATH_MAX
|
---|
40 | # define _POSIX_PATH_MAX 255
|
---|
41 | #endif
|
---|
42 | #ifndef _POSIX_PIPE_BUF
|
---|
43 | # define _POSIX_PIPE_BUF 512
|
---|
44 | #endif
|
---|
45 | #ifndef _POSIX_SSIZE_MAX
|
---|
46 | # define _POSIX_SSIZE_MAX 32767
|
---|
47 | #endif
|
---|
48 | #ifndef _POSIX_STREAM_MAX
|
---|
49 | # define _POSIX_STREAM_MAX 8
|
---|
50 | #endif
|
---|
51 | #ifndef _POSIX_TZNAME_MAX
|
---|
52 | # define _POSIX_TZNAME_MAX 3
|
---|
53 | #endif
|
---|
54 |
|
---|
55 | #ifndef _POSIX2_BC_BASE_MAX
|
---|
56 | # define _POSIX2_BC_BASE_MAX 99
|
---|
57 | #endif
|
---|
58 | #ifndef _POSIX2_BC_DIM_MAX
|
---|
59 | # define _POSIX2_BC_DIM_MAX 2048
|
---|
60 | #endif
|
---|
61 | #ifndef _POSIX2_BC_SCALE_MAX
|
---|
62 | # define _POSIX2_BC_SCALE_MAX 99
|
---|
63 | #endif
|
---|
64 | #ifndef _POSIX2_BC_STRING_MAX
|
---|
65 | # define _POSIX2_BC_STRING_MAX 1000
|
---|
66 | #endif
|
---|
67 | #ifndef _POSIX2_EQUIV_CLASS_MAX
|
---|
68 | # define _POSIX2_EQUIV_CLASS_MAX 2
|
---|
69 | #endif
|
---|
70 | #ifndef _POSIX2_EXPR_NEST_MAX
|
---|
71 | # define _POSIX2_EXPR_NEST_MAX 32
|
---|
72 | #endif
|
---|
73 | #ifndef _POSIX2_LINE_MAX
|
---|
74 | # define _POSIX2_LINE_MAX 2048
|
---|
75 | #endif
|
---|
76 | #ifndef _POSIX2_RE_DUP_MAX
|
---|
77 | # define _POSIX2_RE_DUP_MAX 255
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | /* configurable system variables */
|
---|
81 | #if !defined (HAVE_SYSCONF)
|
---|
82 |
|
---|
83 | #ifndef _SC_ARG_MAX
|
---|
84 | # define _SC_ARG_MAX 1
|
---|
85 | # define _SC_CHILD_MAX 2
|
---|
86 | # define _SC_CLK_TCK 3
|
---|
87 | # define _SC_NGROUPS_MAX 4
|
---|
88 | # define _SC_OPEN_MAX 5
|
---|
89 | # define _SC_JOB_CONTROL 6
|
---|
90 | # define _SC_SAVED_IDS 7
|
---|
91 | # define _SC_VERSION 8
|
---|
92 | # define _SC_BC_BASE_MAX 9
|
---|
93 | # define _SC_BC_DIM_MAX 10
|
---|
94 | # define _SC_BC_SCALE_MAX 11
|
---|
95 | # define _SC_BC_STRING_MAX 12
|
---|
96 | # define _SC_COLL_WEIGHTS_MAX 13
|
---|
97 | # define _SC_EXPR_NEST_MAX 14
|
---|
98 | # define _SC_LINE_MAX 15
|
---|
99 | # define _SC_RE_DUP_MAX 16
|
---|
100 | #if 0
|
---|
101 | # define _SC_2_VERSION 17
|
---|
102 | # define _SC_2_C_BIND 18
|
---|
103 | # define _SC_2_C_DEV 19
|
---|
104 | # define _SC_2_CHAR_TERM 20
|
---|
105 | # define _SC_2_FORT_DEV 21
|
---|
106 | # define _SC_2_FORT_RUN 22
|
---|
107 | # define _SC_2_LOCALEDEF 23
|
---|
108 | # define _SC_2_SW_DEV 24
|
---|
109 | # define _SC_2_UPE 25
|
---|
110 | #endif /* 0 */
|
---|
111 |
|
---|
112 | # define _SC_STREAM_MAX 26
|
---|
113 | # define _SC_TZNAME_MAX 27
|
---|
114 | #endif /* !_SC_ARG_MAX */
|
---|
115 |
|
---|
116 | #endif /* !HAVE_SYSCONF */
|
---|
117 |
|
---|
118 | /* configurable pathname variables */
|
---|
119 | #if !defined (HAVE_PATHCONF)
|
---|
120 |
|
---|
121 | #ifndef _PC_LINK_MAX
|
---|
122 | #define _PC_LINK_MAX 1
|
---|
123 | #define _PC_MAX_CANON 2
|
---|
124 | #define _PC_MAX_INPUT 3
|
---|
125 | #define _PC_NAME_MAX 4
|
---|
126 | #define _PC_PATH_MAX 5
|
---|
127 | #define _PC_PIPE_BUF 6
|
---|
128 | #define _PC_CHOWN_RESTRICTED 7
|
---|
129 | #define _PC_NO_TRUNC 8
|
---|
130 | #define _PC_VDISABLE 9
|
---|
131 | #endif /* !_PC_LINK_MAX */
|
---|
132 |
|
---|
133 | #endif /* !HAVE_PATHCONF */
|
---|
134 |
|
---|
135 | #endif /* _POSIX_VERSION */
|
---|
136 |
|
---|
137 | #ifndef _CS_PATH
|
---|
138 | # define _CS_PATH 1
|
---|
139 | #endif
|
---|
140 |
|
---|
141 | /* ANSI/ISO C, POSIX.1-200x, XPG 4.2 (and later) C language type limits.
|
---|
142 | Defined only if the system include files don't. Assume a 32-bit
|
---|
143 | environment with signed 8-bit characters. */
|
---|
144 |
|
---|
145 | #ifndef CHAR_BIT
|
---|
146 | # define CHAR_BIT 8
|
---|
147 | #endif
|
---|
148 | #ifndef CHAR_MAX
|
---|
149 | # define CHAR_MAX 127
|
---|
150 | #endif
|
---|
151 | #ifndef CHAR_MIN
|
---|
152 | # define CHAR_MIN -128
|
---|
153 | #endif
|
---|
154 |
|
---|
155 | #ifndef INT_BIT
|
---|
156 | # define INT_BIT (sizeof (int) * CHAR_BIT)
|
---|
157 | #endif
|
---|
158 | #ifndef INT_MAX
|
---|
159 | # define INT_MAX 2147483647
|
---|
160 | #endif
|
---|
161 | #ifndef INT_MIN
|
---|
162 | # define INT_MIN (-2147483647-1)
|
---|
163 | #endif
|
---|
164 |
|
---|
165 | #ifndef LONG_BIT
|
---|
166 | # define LONG_BIT (sizeof (long int) * CHAR_BIT)
|
---|
167 | #endif
|
---|
168 | #ifndef LONG_MAX
|
---|
169 | # define LONG_MAX 2147483647L
|
---|
170 | #endif
|
---|
171 | #ifndef LONG_MIN
|
---|
172 | # define LONG_MIN (-2147483647L-1L)
|
---|
173 | #endif
|
---|
174 |
|
---|
175 | #ifndef SCHAR_MAX
|
---|
176 | # define SCHAR_MAX CHAR_MAX
|
---|
177 | #endif
|
---|
178 | #ifndef SCHAR_MIN
|
---|
179 | # define SCHAR_MIN CHAR_MIN
|
---|
180 | #endif
|
---|
181 |
|
---|
182 | #ifndef SHRT_MAX
|
---|
183 | # define SHRT_MAX 32767
|
---|
184 | #endif
|
---|
185 | #ifndef SHRT_MIN
|
---|
186 | # define SHRT_MIN (-32768)
|
---|
187 | #endif
|
---|
188 |
|
---|
189 | #ifndef UCHAR_MAX
|
---|
190 | # define UCHAR_MAX 255
|
---|
191 | #endif
|
---|
192 | #ifndef UINT_MAX
|
---|
193 | # define UINT_MAX 4294967295U
|
---|
194 | #endif
|
---|
195 | #ifndef ULONG_MAX
|
---|
196 | # define ULONG_MAX 4294967295UL
|
---|
197 | #endif
|
---|
198 | #ifndef USHRT_MAX
|
---|
199 | # define UCHAR_MAX 65535
|
---|
200 | #endif
|
---|
201 |
|
---|
202 | /* assume size_t is `unsigned int'; ssize_t is `int' */
|
---|
203 | #ifndef SIZE_MAX
|
---|
204 | # define SIZE_MAX UINT_MAX
|
---|
205 | #endif
|
---|
206 | #ifndef SSIZE_MAX
|
---|
207 | # define SSIZE_MAX INT_MAX
|
---|
208 | #endif
|
---|
209 |
|
---|
210 | #ifndef WORD_BIT
|
---|
211 | # define WORD_BIT (sizeof (int) * CHAR_BIT)
|
---|
212 | #endif
|
---|
213 |
|
---|
214 | #endif /* _GETCONF_H */
|
---|