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