xref: /illumos-gate/usr/src/head/limits.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
530da79d5Sraf  * Common Development and Distribution License (the "License").
630da79d5Sraf  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
2130da79d5Sraf 
227c478bd9Sstevel@tonic-gate /*
230a1278f2SGary Mills  * Copyright (c) 2013 Gary Mills
249c0752acSAndrew Stormont  * Copyright 2017 RackTop Systems.
250a1278f2SGary Mills  *
2630da79d5Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
31*b4203d75SMarcel Telka /*	  All Rights Reserved	*/
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifndef _LIMITS_H
357c478bd9Sstevel@tonic-gate #define	_LIMITS_H
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
387c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
397c478bd9Sstevel@tonic-gate #include <iso/limits_iso.h>
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
437c478bd9Sstevel@tonic-gate  * committee's working draft for the revision of the current ISO C standard,
447c478bd9Sstevel@tonic-gate  * ISO/IEC 9899:1990 Programming language - C.  These are not currently
457c478bd9Sstevel@tonic-gate  * required by any standard but constitute a useful, general purpose set
467c478bd9Sstevel@tonic-gate  * of type definitions and limits which is namespace clean with respect to
477c478bd9Sstevel@tonic-gate  * all standards.
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
507c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
517c478bd9Sstevel@tonic-gate #include <sys/int_limits.h>
527c478bd9Sstevel@tonic-gate #endif
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
557c478bd9Sstevel@tonic-gate extern "C" {
567c478bd9Sstevel@tonic-gate #endif
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
597c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate #define	SSIZE_MAX	LONG_MAX	/* max value of an "ssize_t" */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /*
647c478bd9Sstevel@tonic-gate  * ARG_MAX is calculated as follows:
657c478bd9Sstevel@tonic-gate  * NCARGS - space for other stuff on initial stack
667c478bd9Sstevel@tonic-gate  * like aux vectors, saved registers, etc..
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate #define	_ARG_MAX32	1048320	/* max length of args to exec 32-bit program */
697c478bd9Sstevel@tonic-gate #define	_ARG_MAX64	2096640	/* max length of args to exec 64-bit program */
707c478bd9Sstevel@tonic-gate #ifdef	_LP64
717c478bd9Sstevel@tonic-gate #define	ARG_MAX		_ARG_MAX64	/* max length of arguments to exec */
727c478bd9Sstevel@tonic-gate #else	/* _LP64 */
737c478bd9Sstevel@tonic-gate #define	ARG_MAX		_ARG_MAX32	/* max length of arguments to exec */
747c478bd9Sstevel@tonic-gate #endif	/* _LP64 */
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate #ifndef MAX_CANON
777c478bd9Sstevel@tonic-gate #define	MAX_CANON	256	/* max bytes in line for canonical processing */
787c478bd9Sstevel@tonic-gate #endif
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #ifndef MAX_INPUT
817c478bd9Sstevel@tonic-gate #define	MAX_INPUT	512	/* max size of a char input buffer */
827c478bd9Sstevel@tonic-gate #endif
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #define	NGROUPS_MAX	16	/* max number of groups for a user */
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #ifndef PATH_MAX
877c478bd9Sstevel@tonic-gate #define	PATH_MAX	1024	/* max # of characters in a path name */
887c478bd9Sstevel@tonic-gate #endif
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #define	SYMLINK_MAX	1024	/* max # of characters a symlink can contain */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #define	PIPE_BUF	5120	/* max # bytes atomic in write to a pipe */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #ifndef TMP_MAX
957c478bd9Sstevel@tonic-gate #define	TMP_MAX		17576	/* 26 * 26 * 26 */
967c478bd9Sstevel@tonic-gate #endif
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate /*
997c478bd9Sstevel@tonic-gate  * POSIX conformant definitions - An implementation may define
1007c478bd9Sstevel@tonic-gate  * other symbols which reflect the actual implementation. Alternate
1017c478bd9Sstevel@tonic-gate  * definitions may not be as restrictive as the POSIX definitions.
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate #define	_POSIX_AIO_LISTIO_MAX	    2
1047c478bd9Sstevel@tonic-gate #define	_POSIX_AIO_MAX		    1
1057c478bd9Sstevel@tonic-gate #define	_POSIX_ARG_MAX		 4096
1067c478bd9Sstevel@tonic-gate #ifdef _XPG6
1077c478bd9Sstevel@tonic-gate #define	_POSIX_CHILD_MAX	   25
1087c478bd9Sstevel@tonic-gate #else
1097c478bd9Sstevel@tonic-gate #define	_POSIX_CHILD_MAX	    6	/* POSIX.1-1990 default */
1107c478bd9Sstevel@tonic-gate #endif
1117c478bd9Sstevel@tonic-gate #define	_POSIX_CLOCKRES_MIN	20000000
1127c478bd9Sstevel@tonic-gate #define	_POSIX_DELAYTIMER_MAX	   32
1137c478bd9Sstevel@tonic-gate #define	_POSIX_LINK_MAX		    8
1147c478bd9Sstevel@tonic-gate #define	_POSIX_MAX_CANON	  255
1157c478bd9Sstevel@tonic-gate #define	_POSIX_MAX_INPUT	  255
1167c478bd9Sstevel@tonic-gate #define	_POSIX_MQ_OPEN_MAX	    8
1177c478bd9Sstevel@tonic-gate #define	_POSIX_MQ_PRIO_MAX	   32
1187c478bd9Sstevel@tonic-gate #define	_POSIX_NAME_MAX		   14
1197c478bd9Sstevel@tonic-gate #ifdef _XPG6
1207c478bd9Sstevel@tonic-gate #define	_POSIX_NGROUPS_MAX	    8
1217c478bd9Sstevel@tonic-gate #define	_POSIX_OPEN_MAX		   20
1227c478bd9Sstevel@tonic-gate #define	_POSIX_PATH_MAX		  256
1237c478bd9Sstevel@tonic-gate #else					/* POSIX.1-1990 defaults */
1247c478bd9Sstevel@tonic-gate #define	_POSIX_NGROUPS_MAX	    0
1257c478bd9Sstevel@tonic-gate #define	_POSIX_OPEN_MAX		   16
1267c478bd9Sstevel@tonic-gate #define	_POSIX_PATH_MAX		  255
1277c478bd9Sstevel@tonic-gate #endif
1287c478bd9Sstevel@tonic-gate #define	_POSIX_PIPE_BUF		  512
1297c478bd9Sstevel@tonic-gate #define	_POSIX_RTSIG_MAX	    8
1307c478bd9Sstevel@tonic-gate #define	_POSIX_SEM_NSEMS_MAX	  256
1317c478bd9Sstevel@tonic-gate #define	_POSIX_SEM_VALUE_MAX	32767
1327c478bd9Sstevel@tonic-gate #define	_POSIX_SIGQUEUE_MAX	   32
1337c478bd9Sstevel@tonic-gate #define	_POSIX_SSIZE_MAX	32767
1347c478bd9Sstevel@tonic-gate #define	_POSIX_STREAM_MAX	    8
1357c478bd9Sstevel@tonic-gate #define	_POSIX_TIMER_MAX	   32
1367c478bd9Sstevel@tonic-gate #ifdef _XPG6
1377c478bd9Sstevel@tonic-gate #define	_POSIX_TZNAME_MAX	    6
1387c478bd9Sstevel@tonic-gate #else
1397c478bd9Sstevel@tonic-gate #define	_POSIX_TZNAME_MAX	    3	/* POSIX.1-1990 default */
1407c478bd9Sstevel@tonic-gate #endif
1417c478bd9Sstevel@tonic-gate /* POSIX.1c conformant */
1427c478bd9Sstevel@tonic-gate #define	_POSIX_LOGIN_NAME_MAX			9
1437c478bd9Sstevel@tonic-gate #define	_POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
1447c478bd9Sstevel@tonic-gate #define	_POSIX_THREAD_KEYS_MAX			128
1457c478bd9Sstevel@tonic-gate #define	_POSIX_THREAD_THREADS_MAX		64
1467c478bd9Sstevel@tonic-gate #define	_POSIX_TTY_NAME_MAX			9
1477c478bd9Sstevel@tonic-gate /* UNIX 03 conformant */
1487c478bd9Sstevel@tonic-gate #define	_POSIX_HOST_NAME_MAX			255
1497c478bd9Sstevel@tonic-gate #define	_POSIX_RE_DUP_MAX			255
1507c478bd9Sstevel@tonic-gate #define	_POSIX_SYMLINK_MAX			255
1517c478bd9Sstevel@tonic-gate #define	_POSIX_SYMLOOP_MAX			8
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate /*
1547c478bd9Sstevel@tonic-gate  * POSIX.2 and XPG4-XSH4 conformant definitions
1557c478bd9Sstevel@tonic-gate  */
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate #define	_POSIX2_BC_BASE_MAX		  99
1587c478bd9Sstevel@tonic-gate #define	_POSIX2_BC_DIM_MAX		2048
1597c478bd9Sstevel@tonic-gate #define	_POSIX2_BC_SCALE_MAX		  99
1607c478bd9Sstevel@tonic-gate #define	_POSIX2_BC_STRING_MAX		1000
1617c478bd9Sstevel@tonic-gate #define	_POSIX2_COLL_WEIGHTS_MAX	   2
1627c478bd9Sstevel@tonic-gate #define	_POSIX2_EXPR_NEST_MAX		  32
1637c478bd9Sstevel@tonic-gate #define	_POSIX2_LINE_MAX		2048
1647c478bd9Sstevel@tonic-gate #define	_POSIX2_RE_DUP_MAX		 255
1657c478bd9Sstevel@tonic-gate /* UNIX 03 conformant */
1667c478bd9Sstevel@tonic-gate #define	_POSIX2_CHARCLASS_NAME_MAX	  14
1677c478bd9Sstevel@tonic-gate 
1687c478bd9Sstevel@tonic-gate #define	BC_BASE_MAX		_POSIX2_BC_BASE_MAX
1697c478bd9Sstevel@tonic-gate #define	BC_DIM_MAX		_POSIX2_BC_DIM_MAX
1707c478bd9Sstevel@tonic-gate #define	BC_SCALE_MAX		_POSIX2_BC_SCALE_MAX
1717c478bd9Sstevel@tonic-gate #define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
1727c478bd9Sstevel@tonic-gate #define	COLL_WEIGHTS_MAX	10
1737c478bd9Sstevel@tonic-gate #define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
1747c478bd9Sstevel@tonic-gate #define	LINE_MAX		_POSIX2_LINE_MAX
1757c478bd9Sstevel@tonic-gate #if !defined(_XPG6)
1767c478bd9Sstevel@tonic-gate #define	RE_DUP_MAX		_POSIX2_RE_DUP_MAX
1777c478bd9Sstevel@tonic-gate #else
1787c478bd9Sstevel@tonic-gate #define	RE_DUP_MAX		_POSIX_RE_DUP_MAX
1797c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG6) */
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1847c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1857c478bd9Sstevel@tonic-gate 	defined(_XOPEN_SOURCE)
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate /*
1887c478bd9Sstevel@tonic-gate  * For dual definitions for PASS_MAX and sysconf.c
1897c478bd9Sstevel@tonic-gate  */
1907c478bd9Sstevel@tonic-gate #define	_PASS_MAX_XPG	8	/* old standards PASS_MAX */
1917c478bd9Sstevel@tonic-gate #define	_PASS_MAX	256	/* modern Solaris PASS_MAX */
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate #if defined(_XPG3) && !defined(_XPG6)
1947c478bd9Sstevel@tonic-gate #define	PASS_MAX	_PASS_MAX_XPG	/* max # of characters in a password */
1957c478bd9Sstevel@tonic-gate #else	/* XPG6 or just Solaris */
1967c478bd9Sstevel@tonic-gate #define	PASS_MAX	_PASS_MAX	/* max # of characters in a password */
1977c478bd9Sstevel@tonic-gate #endif	/* defined(_XPG3) && !defined(_XPG6) */
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate #define	CHARCLASS_NAME_MAX	_POSIX2_CHARCLASS_NAME_MAX
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate #define	NL_ARGMAX	9	/* max value of "digit" in calls to the	*/
2027c478bd9Sstevel@tonic-gate 				/* NLS printf() and scanf() */
2037c478bd9Sstevel@tonic-gate #define	NL_LANGMAX	14	/* max # of bytes in a LANG name */
2047c478bd9Sstevel@tonic-gate #define	NL_MSGMAX	32767	/* max message number */
2057c478bd9Sstevel@tonic-gate #define	NL_NMAX		1	/* max # bytes in N-to-1 mapping characters */
2067c478bd9Sstevel@tonic-gate #define	NL_SETMAX	255	/* max set number */
2077c478bd9Sstevel@tonic-gate #define	NL_TEXTMAX	2048	/* max set number */
2087c478bd9Sstevel@tonic-gate #define	NZERO		20	/* default process priority */
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate #define	WORD_BIT	32	/* # of bits in a "word" or "int" */
2117c478bd9Sstevel@tonic-gate #if defined(_LP64)
2127c478bd9Sstevel@tonic-gate #define	LONG_BIT	64	/* # of bits in a "long" */
2137c478bd9Sstevel@tonic-gate #else	/* _ILP32 */
2147c478bd9Sstevel@tonic-gate #define	LONG_BIT	32	/* # of bits in a "long" */
2157c478bd9Sstevel@tonic-gate #endif
2167c478bd9Sstevel@tonic-gate 
2177c478bd9Sstevel@tonic-gate /* Marked as LEGACY in SUSv2 and removed in UNIX 03 */
2187c478bd9Sstevel@tonic-gate #ifndef _XPG6
2197c478bd9Sstevel@tonic-gate #define	DBL_DIG		15	/* digits of precision of a "double" */
2207c478bd9Sstevel@tonic-gate #define	DBL_MAX		1.7976931348623157081452E+308	/* max decimal value */
2217c478bd9Sstevel@tonic-gate 							/* of a double */
2227c478bd9Sstevel@tonic-gate #define	FLT_DIG		6		/* digits of precision of a "float" */
2237c478bd9Sstevel@tonic-gate #define	FLT_MAX		3.4028234663852885981170E+38F	/* max decimal value */
2247c478bd9Sstevel@tonic-gate 							/* of a "float" */
2257c478bd9Sstevel@tonic-gate #endif
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
2287c478bd9Sstevel@tonic-gate #ifndef _XPG5
2297c478bd9Sstevel@tonic-gate #define	DBL_MIN		2.2250738585072013830903E-308	/* min decimal value */
2307c478bd9Sstevel@tonic-gate 							/* of a double */
2317c478bd9Sstevel@tonic-gate #define	FLT_MIN		1.1754943508222875079688E-38F	/* min decimal value */
2327c478bd9Sstevel@tonic-gate 							/* of a float */
2337c478bd9Sstevel@tonic-gate #endif
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate #endif	/* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate #define	_XOPEN_IOV_MAX	16	/* max # iovec/process with readv()/writev() */
2387c478bd9Sstevel@tonic-gate #define	_XOPEN_NAME_MAX	255	/* max # bytes in filename excluding null */
2397c478bd9Sstevel@tonic-gate #define	_XOPEN_PATH_MAX	1024	/* max # bytes in a pathname */
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate #define	IOV_MAX		_XOPEN_IOV_MAX
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
2447c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate #define	FCHR_MAX	1048576		/* max size of a file in bytes */
2477c478bd9Sstevel@tonic-gate #define	PID_MAX		999999		/* max value for a process ID */
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /*
2507c478bd9Sstevel@tonic-gate  * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
2517c478bd9Sstevel@tonic-gate  * related text states:
2527c478bd9Sstevel@tonic-gate  *
2537c478bd9Sstevel@tonic-gate  * A definition of one of the values from Table 2-5 shall be omitted from the
2547c478bd9Sstevel@tonic-gate  * <limits.h> on specific implementations where the corresponding value is
2557c478bd9Sstevel@tonic-gate  * equal to or greater than the stated minimum, but where the value can vary
2567c478bd9Sstevel@tonic-gate  * depending on the file to which it is applied. The actual value supported for
2577c478bd9Sstevel@tonic-gate  * a specific pathname shall be provided by the pathconf() (5.7.1) function.
2587c478bd9Sstevel@tonic-gate  *
2597c478bd9Sstevel@tonic-gate  * This is clear that any machine supporting multiple file system types
2609c0752acSAndrew Stormont  * and/or a network should not include this define, regardless of protection
2619c0752acSAndrew Stormont  * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags. We chose to ignore that
2629c0752acSAndrew Stormont  * and provide it anyway for compatibility with other platforms that don't
2639c0752acSAndrew Stormont  * follow the spec as precisely as they should. Its usage is discouraged.
2647c478bd9Sstevel@tonic-gate  */
2659c0752acSAndrew Stormont #define	NAME_MAX	255
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate #define	CHILD_MAX	25	/* max # of processes per user id */
2687c478bd9Sstevel@tonic-gate #ifndef OPEN_MAX
2697c478bd9Sstevel@tonic-gate #define	OPEN_MAX	256	/* max # of files a process can have open */
2707c478bd9Sstevel@tonic-gate #endif
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate #define	PIPE_MAX	5120	/* max # bytes written to a pipe in a write */
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate #define	STD_BLK		1024	/* # bytes in a physical I/O block */
2757c478bd9Sstevel@tonic-gate #define	UID_MAX		2147483647	/* max value for a user or group ID */
2767c478bd9Sstevel@tonic-gate #define	USI_MAX		4294967295	/* max decimal value of an "unsigned" */
2777c478bd9Sstevel@tonic-gate #define	SYSPID_MAX	1	/* max pid of system processes */
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate #ifndef SYS_NMLN		/* also defined in sys/utsname.h */
2807c478bd9Sstevel@tonic-gate #define	SYS_NMLN	257	/* 4.0 size of utsname elements */
2817c478bd9Sstevel@tonic-gate #endif
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate #ifndef CLK_TCK
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate #if !defined(_CLOCK_T) || __cplusplus >= 199711L
2867c478bd9Sstevel@tonic-gate #define	_CLOCK_T
2877c478bd9Sstevel@tonic-gate typedef long	clock_t;
2887c478bd9Sstevel@tonic-gate #endif	/* !_CLOCK_T */
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate extern long _sysconf(int);	/* System Private interface to sysconf() */
2917c478bd9Sstevel@tonic-gate #define	CLK_TCK	((clock_t)_sysconf(3))	/* 3 is _SC_CLK_TCK */
2927c478bd9Sstevel@tonic-gate 
2937c478bd9Sstevel@tonic-gate #endif /* CLK_TCK */
2947c478bd9Sstevel@tonic-gate 
2950a1278f2SGary Mills #ifdef	__USE_LEGACY_LOGNAME__
2967c478bd9Sstevel@tonic-gate #define	LOGNAME_MAX	8	/* max # of characters in a login name */
2970a1278f2SGary Mills #else	/* __USE_LEGACY_LOGNAME__ */
2980a1278f2SGary Mills #define	LOGNAME_MAX	32	/* max # of characters in a login name */
2990a1278f2SGary Mills 				/* Increased for illumos */
3000a1278f2SGary Mills #endif	/* __USE_LEGACY_LOGNAME__ */
3010a1278f2SGary Mills #define	LOGIN_NAME_MAX	(LOGNAME_MAX + 1)	/* max buffer size */
3020a1278f2SGary Mills #define	LOGNAME_MAX_TRAD	8		/* traditional length */
3030a1278f2SGary Mills #define	LOGIN_NAME_MAX_TRAD	(LOGNAME_MAX_TRAD + 1)	/* and size */
3040a1278f2SGary Mills 
3057c478bd9Sstevel@tonic-gate #define	TTYNAME_MAX	128	/* max # of characters in a tty name */
3067c478bd9Sstevel@tonic-gate 
3077c478bd9Sstevel@tonic-gate #endif	/* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
3087c478bd9Sstevel@tonic-gate 
3097c478bd9Sstevel@tonic-gate #if	defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L)
3107c478bd9Sstevel@tonic-gate #include <sys/unistd.h>
3117c478bd9Sstevel@tonic-gate 
3127c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
3137c478bd9Sstevel@tonic-gate #define	_SIZE_T
3147c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
3157c478bd9Sstevel@tonic-gate typedef	unsigned long size_t;	/* size of something in bytes */
3167c478bd9Sstevel@tonic-gate #else
3177c478bd9Sstevel@tonic-gate typedef	unsigned int  size_t;	/* (historical version) */
3187c478bd9Sstevel@tonic-gate #endif
3197c478bd9Sstevel@tonic-gate #endif	/* _SIZE_T */
3207c478bd9Sstevel@tonic-gate 
3217c478bd9Sstevel@tonic-gate extern long _sysconf(int);	/* System Private interface to sysconf() */
3227c478bd9Sstevel@tonic-gate 
3237c478bd9Sstevel@tonic-gate #define	PTHREAD_STACK_MIN	((size_t)_sysconf(_SC_THREAD_STACK_MIN))
3247c478bd9Sstevel@tonic-gate /* Added for UNIX98 conformance */
3257c478bd9Sstevel@tonic-gate #define	PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
3267c478bd9Sstevel@tonic-gate #define	PTHREAD_KEYS_MAX		_POSIX_THREAD_KEYS_MAX
3277c478bd9Sstevel@tonic-gate #define	PTHREAD_THREADS_MAX		_POSIX_THREAD_THREADS_MAX
3287c478bd9Sstevel@tonic-gate #endif	/* defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L) */
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3317c478bd9Sstevel@tonic-gate }
3327c478bd9Sstevel@tonic-gate #endif
3337c478bd9Sstevel@tonic-gate 
3347c478bd9Sstevel@tonic-gate #endif	/* _LIMITS_H */
335