7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2013 Gary Mills
24 *
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 /* Copyright (c) 1988 AT&T */
30 /* All Rights Reserved */
31
32
33 #ifndef _LIMITS_H
34 #define _LIMITS_H
35
36 #include <sys/feature_tests.h>
37 #include <sys/isa_defs.h>
38 #include <iso/limits_iso.h>
39
40 /*
41 * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
42 * committee's working draft for the revision of the current ISO C standard,
43 * ISO/IEC 9899:1990 Programming language - C. These are not currently
44 * required by any standard but constitute a useful, general purpose set
45 * of type definitions and limits which is namespace clean with respect to
46 * all standards.
47 */
48 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
49 defined(__XOPEN_OR_POSIX)
50 #include <sys/int_limits.h>
51 #endif
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
58 defined(__XOPEN_OR_POSIX)
220 /* of a double */
221 #define FLT_DIG 6 /* digits of precision of a "float" */
222 #define FLT_MAX 3.4028234663852885981170E+38F /* max decimal value */
223 /* of a "float" */
224 #endif
225
226 /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
227 #ifndef _XPG5
228 #define DBL_MIN 2.2250738585072013830903E-308 /* min decimal value */
229 /* of a double */
230 #define FLT_MIN 1.1754943508222875079688E-38F /* min decimal value */
231 /* of a float */
232 #endif
233
234 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
235
236 #define _XOPEN_IOV_MAX 16 /* max # iovec/process with readv()/writev() */
237 #define _XOPEN_NAME_MAX 255 /* max # bytes in filename excluding null */
238 #define _XOPEN_PATH_MAX 1024 /* max # bytes in a pathname */
239
240 #define IOV_MAX _XOPEN_IOV_MAX
241
242 #if defined(__EXTENSIONS__) || \
243 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
244
245 #define FCHR_MAX 1048576 /* max size of a file in bytes */
246 #define PID_MAX 999999 /* max value for a process ID */
247
248 /*
249 * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
250 * related text states:
251 *
252 * A definition of one of the values from Table 2-5 shall be omitted from the
253 * <limits.h> on specific implementations where the corresponding value is
254 * equal to or greater than the stated minimum, but where the value can vary
255 * depending on the file to which it is applied. The actual value supported for
256 * a specific pathname shall be provided by the pathconf() (5.7.1) function.
257 *
258 * This is clear that any machine supporting multiple file system types
259 * and/or a network can not include this define, regardless of protection
260 * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
261 *
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2013 Gary Mills
24 *
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 * Copyright 2015 Joyent, Inc. All rights reserved.
28 */
29
30 /* Copyright (c) 1988 AT&T */
31 /* All Rights Reserved */
32
33
34 #ifndef _LIMITS_H
35 #define _LIMITS_H
36
37 #include <sys/feature_tests.h>
38 #include <sys/isa_defs.h>
39 #include <iso/limits_iso.h>
40 #include <sys/limits.h>
41
42 /*
43 * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
44 * committee's working draft for the revision of the current ISO C standard,
45 * ISO/IEC 9899:1990 Programming language - C. These are not currently
46 * required by any standard but constitute a useful, general purpose set
47 * of type definitions and limits which is namespace clean with respect to
48 * all standards.
49 */
50 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
51 defined(__XOPEN_OR_POSIX)
52 #include <sys/int_limits.h>
53 #endif
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
60 defined(__XOPEN_OR_POSIX)
222 /* of a double */
223 #define FLT_DIG 6 /* digits of precision of a "float" */
224 #define FLT_MAX 3.4028234663852885981170E+38F /* max decimal value */
225 /* of a "float" */
226 #endif
227
228 /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
229 #ifndef _XPG5
230 #define DBL_MIN 2.2250738585072013830903E-308 /* min decimal value */
231 /* of a double */
232 #define FLT_MIN 1.1754943508222875079688E-38F /* min decimal value */
233 /* of a float */
234 #endif
235
236 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
237
238 #define _XOPEN_IOV_MAX 16 /* max # iovec/process with readv()/writev() */
239 #define _XOPEN_NAME_MAX 255 /* max # bytes in filename excluding null */
240 #define _XOPEN_PATH_MAX 1024 /* max # bytes in a pathname */
241
242 #if defined(__EXTENSIONS__) || \
243 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
244
245 #define FCHR_MAX 1048576 /* max size of a file in bytes */
246 #define PID_MAX 999999 /* max value for a process ID */
247
248 /*
249 * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
250 * related text states:
251 *
252 * A definition of one of the values from Table 2-5 shall be omitted from the
253 * <limits.h> on specific implementations where the corresponding value is
254 * equal to or greater than the stated minimum, but where the value can vary
255 * depending on the file to which it is applied. The actual value supported for
256 * a specific pathname shall be provided by the pathconf() (5.7.1) function.
257 *
258 * This is clear that any machine supporting multiple file system types
259 * and/or a network can not include this define, regardless of protection
260 * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
261 *
|