3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
29
30
31 #ifndef _LIMITS_H
32 #define _LIMITS_H
33
34 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.34 */
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
273 #define UID_MAX 2147483647 /* max value for a user or group ID */
274 #define USI_MAX 4294967295 /* max decimal value of an "unsigned" */
275 #define SYSPID_MAX 1 /* max pid of system processes */
276
277 #ifndef SYS_NMLN /* also defined in sys/utsname.h */
278 #define SYS_NMLN 257 /* 4.0 size of utsname elements */
279 #endif
280
281 #ifndef CLK_TCK
282
283 #if !defined(_CLOCK_T) || __cplusplus >= 199711L
284 #define _CLOCK_T
285 typedef long clock_t;
286 #endif /* !_CLOCK_T */
287
288 extern long _sysconf(int); /* System Private interface to sysconf() */
289 #define CLK_TCK ((clock_t)_sysconf(3)) /* 3 is _SC_CLK_TCK */
290
291 #endif /* CLK_TCK */
292
293 #define LOGNAME_MAX 8 /* max # of characters in a login name */
294 #define TTYNAME_MAX 128 /* max # of characters in a tty name */
295
296 #endif /* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
297
298 #if defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L)
299 #include <sys/unistd.h>
300
301 #if !defined(_SIZE_T) || __cplusplus >= 199711L
302 #define _SIZE_T
303 #if defined(_LP64) || defined(_I32LPx)
304 typedef unsigned long size_t; /* size of something in bytes */
305 #else
306 typedef unsigned int size_t; /* (historical version) */
307 #endif
308 #endif /* _SIZE_T */
309
310 extern long _sysconf(int); /* System Private interface to sysconf() */
311
312 #define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))
313 /* Added for UNIX98 conformance */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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
273 #define UID_MAX 2147483647 /* max value for a user or group ID */
274 #define USI_MAX 4294967295 /* max decimal value of an "unsigned" */
275 #define SYSPID_MAX 1 /* max pid of system processes */
276
277 #ifndef SYS_NMLN /* also defined in sys/utsname.h */
278 #define SYS_NMLN 257 /* 4.0 size of utsname elements */
279 #endif
280
281 #ifndef CLK_TCK
282
283 #if !defined(_CLOCK_T) || __cplusplus >= 199711L
284 #define _CLOCK_T
285 typedef long clock_t;
286 #endif /* !_CLOCK_T */
287
288 extern long _sysconf(int); /* System Private interface to sysconf() */
289 #define CLK_TCK ((clock_t)_sysconf(3)) /* 3 is _SC_CLK_TCK */
290
291 #endif /* CLK_TCK */
292
293 #ifdef __USE_LEGACY_LOGNAME__
294 #define LOGNAME_MAX 8 /* max # of characters in a login name */
295 #else /* __USE_LEGACY_LOGNAME__ */
296 #define LOGNAME_MAX 32 /* max # of characters in a login name */
297 /* Increased for illumos */
298 #endif /* __USE_LEGACY_LOGNAME__ */
299 #define LOGIN_NAME_MAX (LOGNAME_MAX + 1) /* max buffer size */
300 #define LOGNAME_MAX_TRAD 8 /* traditional length */
301 #define LOGIN_NAME_MAX_TRAD (LOGNAME_MAX_TRAD + 1) /* and size */
302
303 #define TTYNAME_MAX 128 /* max # of characters in a tty name */
304
305 #endif /* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
306
307 #if defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L)
308 #include <sys/unistd.h>
309
310 #if !defined(_SIZE_T) || __cplusplus >= 199711L
311 #define _SIZE_T
312 #if defined(_LP64) || defined(_I32LPx)
313 typedef unsigned long size_t; /* size of something in bytes */
314 #else
315 typedef unsigned int size_t; /* (historical version) */
316 #endif
317 #endif /* _SIZE_T */
318
319 extern long _sysconf(int); /* System Private interface to sysconf() */
320
321 #define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))
322 /* Added for UNIX98 conformance */
|