#
# posix limits,unistd,confstr,fpathconf,pathconf,sysconf macro table
#
# @(#)conf.tab (AT&T Research) 2003-06-03
#
# name index standard section call flags [ value ... ]
# [ <tab> _LOCAL_name macro definition ... ]
#
# name:		sans prefix
# index:	starts at 1, must not change or be reused
# standard:	AST, C, POSIX, SVID, XOPEN, <vendor> { SCO, SGI, SUN, ... }
# section:	section number in standard
# call:		CS=confstr PC=pathconf SC=sysconf SI=sysinfo QQ=query XX=none
# flags:	0	no flags
#		F	feature for unistd.h
#		L	constant for limits.h
#		M	has _<standard><section>_<name> minmax value
#		N	_<call>_<name>
#		O	use original name and definition
#		R	_<standard>_<call>_<section>_<name>
#		S	_<call>_<standard><section>_<name>
#		U	<standard><section>_<name> prefixed by underscore
#		X	define even if local is indeterminant (ast special)
#
# default names if <section> <= 1
#
#	_<call>_<name>
#	<standard>_<name>
#
# default names if <section> > 1
#
#	_<call>_<section>_<name>
#	<standard><section>_<name>
#
# the [NSU] flags modify the default names
#

AIO_LISTIO_MAX		1	POSIX	SC 1 LMU	2
AIO_MAX			2	POSIX	SC 1 LMU	1
AIO_PRIO_DELTA_MAX	3	POSIX	SC 1 LMU
ARG_MAX			4	POSIX	SC 1 LMU	NCARGS 4096
ASYNCHRONOUS_IO		5	POSIX	SC 1 FU
ASYNC_IO		6	POSIX	PC 1 FU
ATEXIT_MAX		82	XOPEN	SC 1 LMU	32
AVPHYS_PAGES		121	SUN	SC 1 0
BC_BASE_MAX		7	POSIX	SC 2 LMN	99
BC_DIM_MAX		8	POSIX	SC 2 LMN	2048
BC_SCALE_MAX		9	POSIX	SC 2 LMN	99
BC_STRING_MAX		10	POSIX	SC 2 LMN	1000
CHARCLASS_NAME_MAX	102	XOPEN	XX 1 L		14
CHAR_BIT		13	C	XX 1 L		8
CHAR_MAX		14	C	XX 1 L
CHAR_MIN		15	C	XX 1 L
CHAR_TERM		16	POSIX	SC 2 F
CHILD_MAX		17	POSIX	SC 1 LMU	6
	#define _LOCAL_CHILD_MAX	local_child_max()
	#if _lib_fork
	#define child()		fork()
	#else
	#ifdef	_map_spawnve
	#define spawnve		_map_spawnve
	#endif
	extern int		spawnve(const char*, char* const[], char* const[]);
	static char*		cmd[] = { "/bin/echo", 0 };
	#define child()		spawnve(cmd[0],cmd,(char**)0)
	#endif
	static int
	local_child_max(void)
	{
		int	i;
		int	n;
		for (i = 3; i < 512 && (n = child()) >= 0; i++)
			if (!n) _exit(0);
		while (wait((int*)0) > 0);
		for (n = 8; n < i; n <<= 1);
		return(n);
	}
CHOWN_RESTRICTED	18	POSIX	PC 1 FU
CKPT			97	POSIX	SC 1 FU
CLK_TCK			19	AST	SC 1 MU		HZ 60
CLOCKRES_MIN		20	POSIX	SC 1 MU		1
COLL_WEIGHTS_MAX	21	POSIX	SC 2 LMN	2
CRYPT			116	XOPEN	SC 1 FSU
C_BIND			11	POSIX	SC 2 F
C_DEV			12	POSIX	SC 2 F
C_VERSION		98	POSIX	SC 2 FU
DELAYTIMER_MAX		22	POSIX	SC 1 LMU	32
ENH_I18N		117	XOPEN	SC 1 FSU
EXPR_NEST_MAX		23	POSIX	SC 2 LMN	32
FCHR_MAX		24	SVID	SC 1 LMU	LONG_MAX 2147483647
FILESIZEBITS		154	POSIX	PC 1 LMU	32
	#define _LOCAL_FILESIZEBITS	(8*sizeof(off_t))
FORT_DEV		25	POSIX	SC 2 F
FORT_RUN		26	POSIX	SC 2 F
FSYNC			27	POSIX	SC 1 FU		_lib_fsync
INT_MAX			28	C	XX 1 L		32767
INT_MIN			29	C	XX 1 L		-32767
IOV_MAX			100	XOPEN	SC 1 LMU	16
JOB_CONTROL		30	POSIX	SC 1 FU
	#include "FEATURE/wait"
	#if _ok_wif
	#define _LOCAL_JOB_CONTROL	1
	#endif
KERNEL_CLIST		132	SCO	SC 1 0
KERNEL_CLIST_MAX	133	SCO	SC 1 0
KERNEL_DISK		134	SCO	SC 1 0
KERNEL_DISK_MAX		135	SCO	SC 1 0
KERNEL_DMABUF		136	SCO	SC 1 0
KERNEL_DMABUF_MAX	137	SCO	SC 1 0
KERNEL_FILE		138	SCO	SC 1 0
KERNEL_FILE_MAX		139	SCO	SC 1 0
KERNEL_FLCKREC		140	SCO	SC 1 0
KERNEL_FLCKREC_MAX	141	SCO	SC 1 0
KERNEL_INODE		142	SCO	SC 1 0
KERNEL_INODE_MAX	143	SCO	SC 1 0
KERNEL_MOUNT		144	SCO	SC 1 0
KERNEL_MOUNT_MAX	145	SCO	SC 1 0
KERNEL_PINODE		146	SCO	SC 1 0
KERNEL_PINODE_MAX	147	SCO	SC 1 0
KERNEL_PROC		148	SCO	SC 1 0
KERNEL_PROC_MAX		149	SCO	SC 1 0
KERNEL_REGION		150	SCO	SC 1 0
KERNEL_REGION_MAX	151	SCO	SC 1 0
KERNEL_S5INODE		152	SCO	SC 1 0
KERNEL_S5INODE_MAX	153	SCO	SC 1 0
LFS_CFLAGS		155	POSIX	CS 1 MU	{
	cat > $tmp.c <<!
	#include <sys/types.h>
	main() { return sizeof(off_t) != sizeof(off64_t); }
	!
	for i in -D_LARGEFILE_SOURCE "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -D_LARGEFILE64_SOURCE -64
	do	if	$cc -o $tmp.x $i $tmp.c && ./$tmp.x
		then	echo '"'$i'"'; break
		fi
	done
}
LFS_LDFLAGS		156	POSIX	CS 1 MU	{ LFS_CFLAGS }
LFS_LINTFLAGS		157	POSIX	CS 1 MU { LFS_CFLAGS }
LFS_LIBS		158	POSIX	CS 1 MU
LFS64_CFLAGS		159	POSIX	CS 1 MU	{ LFS_CFLAGS }
LFS64_LDFLAGS		160	POSIX	CS 1 MU	{ LFS_CFLAGS }
LFS64_LINTFLAGS		161	POSIX	CS 1 MU	{ LFS_CFLAGS }
LFS64_LIBS		162	POSIX	CS 1 MU
LINE_MAX		31	POSIX	SC 2 LMN	2048
LINK_MAX		32	POSIX	PC 1 LMU	MAXLINK SHRT_MAX 8
LOCALEDEF		99	POSIX	SC 1 FU
LOCALEDEF		33	POSIX	SC 2 F
LOGNAME_MAX		129	SVID	SC 1 MU		8
LONG_BIT		56	XOPEN	XX 1 L		32
	#ifdef	CHAR_BIT
	#define _LOCAL_LONG_BIT		(CHAR_BIT*sizeof(long))
	#else
	#define _LOCAL_LONG_BIT		(8*sizeof(int))
	#endif
LONG_MAX		34	C	XX 1 L		2147483647
LONG_MIN		35	C	XX 1 L		-2147483647
MAPPED_FILES		36	POSIX	SC 1 FU		_lib_mmap
MAX_CANON		37	POSIX	PC 1 LMU	CANBSIZ 255
MAX_INPUT		38	POSIX	PC 1 LMU	MAX_CANON 255	
MB_LEN_MAX		39	C	XX 1 L		1
MEMLOCK			40	POSIX	SC 1 FU
MEMLOCK_RANGE		41	POSIX	SC 1 FU
MEMORY_PROTECTION	42	POSIX	SC 1 FU
MESSAGE_PASSING		43	POSIX	SC 1 FU
MQ_OPEN_MAX		44	POSIX	SC 1 LMU	8
MQ_PRIO_MAX		45	POSIX	SC 1 LMU	32
NACLS_MAX		122	SVID	SC 1 0
NAME_MAX		46	POSIX	PC 1 LMU	14
	#ifdef MAXNAMLEN
	#define _LOCAL_NAME_MAX	MAXNAMLEN
	#else
	#define _LOCAL_NAME_MAX	local_name_max()
	#if !defined(remove) && (!_lib_remove || _lib_unlink)
	#define remove		unlink
	#endif
	static int
	local_name_max(void)
	{
		int	i;
		int	n;
		int	v;
		char	name[256];
		for (i = 0; i < sizeof(name); i++)
			name[i] = 'F';
		name[8] = '.';
		name[sizeof(name) - 1] = 0;
		if ((n = creat(name, 0666)) >= 0)
		{
			close(n);
			for (v = 12; v < sizeof(name); v++)
			{
				name[v] = 0;
				if (remove(name) >= 0) break;
				name[v] = 'F';
			}
		}
		else for (v = 12; v < sizeof(name); v++)
		{
			name[v] = 0;
			if ((n = creat(name, 0666)) >= 0)
			{
				close(n);
				remove(name);
				name[v] = 'F';
			}
			else
			{
				v--;
				break;
			}
		}
		return(v);
	}
	#endif
NGROUPS_MAX		47	POSIX	SC 1 LMU	0
	#if _lib_getgroups
	#define _LOCAL_NGROUPS_MAX	local_ngroups_max()
	static int
	local_ngroups_max(void)
	{
		int	n;
		gid_t	g;
		if ((n = getgroups(0, &g)) < 0)
	#if defined(NGROUPS) && (NGROUPS-0) > 0
			n = NGROUPS;
	#else
			n = 0;
	#endif
		return(n);
	}
	#endif
NL_ARGMAX		103	XOPEN	XX 1 L		9
NL_LANGMAX		104	XOPEN	XX 1 L		14
NL_MSGMAX		105	XOPEN	XX 1 L		32767
NL_NMAX			106	XOPEN	XX 1 L		1
NL_SETMAX		107	XOPEN	XX 1 L		255
NL_TEXTMAX		108	XOPEN	XX 1 L		LINE_MAX
NO_TRUNC		48	POSIX	PC 1 FU
NPROCESSORS_CONF	123	SVID	SC 1 0
NPROCESSORS_ONLN	124	SVID	SC 1 0
NZERO			109	XOPEN	XX 1 L		20
OPEN_MAX		49	POSIX	SC 1 LMU	16
	#if _lib_getdtablesize
	extern int		getdtablesize(void);
	#define _LOCAL_OPEN_MAX	getdtablesize()
	#else
	#define _LOCAL_OPEN_MAX	local_open_max()
	static int
	local_open_max(void)
	{
		int	i;
		int	n;
		int	v;
		n = 0;
		v = 2;
		while ((i = dup(0)) >= 0)
		{
			if (!n) n = i;
			if (i > v) v = i;
		}
		while (n <= v) close(n++);
		return(v + 1);
	}
	#endif
OPEN_MAX_CEIL		50	AST	XX 1 L		OPEN_MAX
OS_VERSION		119	AES	SC 1 FSU
PAGESIZE		51	POSIX	SC 1 L		PAGE_SIZE 4096
	#if _WIN32
	#define _LOCAL_PAGESIZE	(64*1024L)
	#else
	#if _lib_getpagesize
	#if _npt_getpagesize
	extern size_t		getpagesize(void);
	#endif
	#define _LOCAL_PAGESIZE	getpagesize()
	#endif
	#endif
PAGE_SIZE		101	XOPEN	SC 1 L		PAGESIZE
PASS_MAX		130	SVID	SC 1 LMU	8
PATH			52	POSIX	CS 1 MU		"/bin:/usr/bin"
PATH_MAX		53	POSIX	PC 1 LMUX	MAXPATHLEN 1024 256
PHYS_PAGES		125	SUN	SC 1 0
PID_MAX			54	SVID	SC 1 LMU	30000
PIPE_BUF		55	POSIX	PC 1 LMU	512
PRIORITIZED_IO		57	POSIX	SC 1 FU
PRIORITY_SCHEDULING	58	POSIX	SC 1 FU
PRIO_IO			59	POSIX	PC 1 FU
REALTIME_SIGNALS	60	POSIX	SC 1 FU
REGEXP			95	POSIX	SC 1 FU
RESOURCE_LIMITS		96	POSIX	SC 1 FU
RE_DUP_MAX		61	POSIX	SC 2 LMN	255
RTSIG_MAX		62	POSIX	SC 1 LMU	8
SAVED_IDS		63	POSIX	SC 1 FU
	#if _lib_setuid && !_lib_setreuid
	#define _LOCAL_SAVED_IDS	1
	#endif
SCHAR_MAX		64	C	XX 1 L		127
SCHAR_MIN		65	C	XX 1 L		-127
SEMAPHORES		66	POSIX	SC 1 FU
SEM_NSEMS_MAX		67	POSIX	SC 1 LMU	256
SEM_VALUE_MAX		68	POSIX	SC 1 LMU	32767
SHARED_MEMORY_OBJECTS	69	POSIX	SC 1 FU
SHELL			120	AST	CS 1 MU		"/bin/sh"
SHM			118	XOPEN	SC 1 FSU
SHRT_MAX		70	C	XX 1 L		32767
SHRT_MIN		71	C	XX 1 L		-32767
SIGQUEUE_MAX		72	POSIX	SC 1 LMU	32
SIGRT_MAX		126	SVID	SC 1 0
SIGRT_MIN		127	SVID	SC 1 0
SSIZE_MAX		73	POSIX	XX 1 LMU	INT_MAX 32767
STD_BLK			74	SVID	SC 1 LMU	1024
STREAM_MAX		75	POSIX	SC 1 LMU	OPEN_MAX 8
SW_DEV			76	POSIX	SC 2 F
SYMLINK_MAX		93	POSIX	PC 1 LMU	255
	#if defined(PATH_MAX) && (PATH_MAX-0) > 0
	#define _LOCAL_SYMLINK_MAX	(PATH_MAX-1)
	#endif
SYMLOOP_MAX		94	POSIX	PC 1 LMU	8
SYNCHRONIZED_IO		77	POSIX	SC 1 FU
SYNC_IO			78	POSIX	PC 1 FU
SYSPID_MAX		79	SVID	SC 1 LMU	2
TIMERS			80	POSIX	SC 1 FU
TIMER_MAX		81	POSIX	SC 1 LMU	32
TMP			131	AST	CS 1 MU		"/tmp"
TMP_MAX			128	C	SC 1 LMU	33520641
TZNAME_MAX		83	POSIX	SC 1 LMU	6
UCHAR_MAX		84	C	XX 1 L		255
UID_MAX			85	SVID	SC 1 LMU	60002
UINT_MAX		86	C	XX 1 L		65535
ULONG_MAX		87	C	XX 1 L		4294967295
UNIX			115	XOPEN	SC 1 FSU
UPE			89	POSIX	SC 2 F
USHRT_MAX		88	C	XX 1 L		65535
VDISABLE		90	POSIX	PC 1 FU
VERSION			91	POSIX	SC 1 FU		199009
VERSION			92	POSIX	SC 2 FU		199209
VERSION			110	XOPEN	SC 1 FSU	4
WORD_BIT		56	XOPEN	XX 1 L		16
	#ifdef	CHAR_BIT
	#define _LOCAL_WORD_BIT		(CHAR_BIT*sizeof(int))
	#else
	#define _LOCAL_WORD_BIT		(8*sizeof(int))
	#endif
XCU_VERSION		111	XOPEN	SC 1 FSU
XPG2			112	XOPEN	XX 1 FU
XPG3			113	XOPEN	XX 1 FU
XPG4			114	XOPEN	XX 1 FU

# confgen additions

ABI_AIO_XFER_MAX		164	C	QQ 1 L
ABI_ASYNCHRONOUS_IO		165	C	QQ 1 L
ABI_ASYNC_IO			166	C	QQ 1 L
AUDIT				167	C	QQ 1 L
AVAIL_PROCESSORS		168	C	QQ 1 L
CLOCKS_PER_SEC			169	C	QQ 1 L
CPU_KEYBITS1			170	C	QQ 1 L
CPU_VERSION			171	C	QQ 1 L
DATAKEYS_MAX			172	C	QQ 1 0
EQUIV_CLASS_MAX			173	C	QQ 1 L
EXEC_INTERPRETER_LENGTH		174	C	QQ 1 L
GETGR_R_SIZE_MAX		175	C	QQ 1 L
GETPW_R_SIZE_MAX		275	C	QQ 1 L
HOSTID				176	C	QQ 1 L
HW_SERIAL			177	C	QQ 1 L
ILP32_OFF32			178	XBS5	SC 1 FU
ILP32_OFF32_CFLAGS		179	XBS5	CS 1 FU
ILP32_OFF32_LDFLAGS		180	XBS5	CS 1 FU
ILP32_OFF32_LIBS		181	XBS5	CS 1 FU
ILP32_OFF32_LINTFLAGS		182	XBS5	CS 1 FU
ILP32_OFFBIG			183	XBS5	SC 1 FU
ILP32_OFFBIG_CFLAGS		184	XBS5	CS 1 FU
ILP32_OFFBIG_LDFLAGS		185	XBS5	CS 1 FU
ILP32_OFFBIG_LIBS		186	XBS5	CS 1 FU
ILP32_OFFBIG_LINTFLAGS		187	XBS5	CS 1 FU
IO_TYPE				188	C	QQ 1 L
IP_SECOPTS			189	C	QQ 1 L
KERN_POINTERS			190	C	QQ 1 L
KERN_SIM			191	C	QQ 1 L
LEGACY				192	XOPEN	SC 1 FU
LOGIN_NAME_MAX			193	POSIX	SC 1 LMU
LONGLONG_MAX			194	C	XX 1 L
LONGLONG_MIN			195	C	XX 1 L
LP64_OFF64			196	XBS5	SC 1 FU
LP64_OFF64_CFLAGS		197	XBS5	CS 1 FU
LP64_OFF64_LDFLAGS		198	XBS5	CS 1 FU
LP64_OFF64_LIBS			199	XBS5	CS 1 FU
LP64_OFF64_LINTFLAGS		200	XBS5	CS 1 FU
LPBIG_OFFBIG			201	XBS5	SC 1 FU
LPBIG_OFFBIG_CFLAGS		202	XBS5	CS 1 FU
LPBIG_OFFBIG_LDFLAGS		203	XBS5	CS 1 FU
LPBIG_OFFBIG_LIBS		204	XBS5	CS 1 FU
LPBIG_OFFBIG_LINTFLAGS		205	XBS5	CS 1 FU
MCAS_OFFSET			206	C	QQ 1 L
MMAP_FIXED_ALIGNMENT		207	C	QQ 1 L		PAGESIZE
MSEM_LOCKID			208	C	QQ 1 L
NL_MAX				209	C	QQ 1 L
NL_SPECMAX			210	C	QQ 1 L
NPROC_CONF			211	C	QQ 1 L
NPROC_ONLN			212	C	QQ 1 L
NSS_BUFLEN_GROUP		213	C	QQ 1 L
NSS_BUFLEN_PASSWD		214	C	QQ 1 L
NUM_PROCESSORS			215	C	QQ 1 L
OSREL_MAJ			216	C	QQ 1 L
OSREL_MIN			217	C	QQ 1 L
OSREL_PATCH			218	C	QQ 1 L
PII				219	POSIX	SC 1 FU
PII_INTERNET			220	POSIX	SC 1 FU
PII_INTERNET_DGRAM		221	POSIX	SC 1 FU
PII_INTERNET_STREAM		222	POSIX	SC 1 FU
PII_OSI				223	POSIX	SC 1 FU
PII_OSI_CLTS			224	POSIX	SC 1 FU
PII_OSI_COTS			225	POSIX	SC 1 FU
PII_OSI_M			226	POSIX	SC 1 FU
PII_SOCKET			227	POSIX	SC 1 FU
PII_XTI				228	POSIX	SC 1 FU
POLL				229	POSIX	SC 1 FU
PROC_RSRC_MGR			230	C	QQ 1 L
PTHREAD_DESTRUCTOR_ITERATIONS	231	C	QQ 1 L
PTHREAD_KEYS_MAX		232	C	QQ 1 L
PTHREAD_STACK_MIN		233	C	QQ 1 L
PTHREAD_THREADS_MAX		234	C	QQ 1 L
REALTIME			235	XOPEN	SC 1 FU
REALTIME_THREADS		236	XOPEN	SC 1 FU
REENTRANT_FUNCTIONS		237	POSIX	SC 1 FU
RELEASE				238	C	QQ 1 L
SECURITY_CLASS			239	C	QQ 1 L
SELECT				240	POSIX	SC 1 FU
SIZE_MAX			241	C	XX 1 L
SLVM_MAXNODES			242	C	QQ 1 L
SOCK_MAXBUF			243	C	QQ 1 0
SOFTPOWER			244	C	QQ 1 L
SRPC_DOMAIN			245	C	QQ 1 0
THREADS				246	POSIX	SC 1 FU
THREADS_PRIO_CEILING		247	POSIX	SC 1 FU
THREADS_PRIO_INHERIT		248	POSIX	SC 1 FU
THREAD_ATTR_STACKADDR		249	POSIX	SC 1 F
THREAD_ATTR_STACKSIZE		250	POSIX	SC 1 F
THREAD_DESTRUCTOR_ITERATIONS	251	POSIX	SC 1 LMU
THREAD_KEYS_MAX			252	POSIX	SC 1 LMU
THREAD_PRIORITY_SCHEDULING	253	POSIX	SC 1 F
THREAD_PRIO_INHERIT		254	POSIX	SC 1 F
THREAD_PRIO_PROTECT		255	POSIX	SC 1 F
THREAD_PROCESS_SHARED		256	POSIX	SC 1 F
THREAD_SAFE_FUNCTIONS		257	POSIX	SC 1 F
THREAD_STACK_MIN		258	C	QQ 1 L
THREAD_THREADS_MAX		259	POSIX	SC 1 LMU
TTY_NAME_MAX			260	POSIX	SC 1 LMU
T_IOV_MAX			261	C	QQ 1 0
UCHAR_MIN			262	C	XX 1 L
UIO_MAXIOV			263	C	QQ 1 0
ULONGLONG_MAX			264	C	XX 1 L
VERSION				266	XPG	SC 3 FU
VERSION				267	XPG	SC 4 FU
VERSION_88			268	POSIX	SC 1 FU
VERSION_88			269	C	XX 1 L
VERSION_90			270	POSIX	SC 1 FU
VERSION_90			271	C	XX 1 L
VERSION_93			272	POSIX	SC 1 FU
VERSION_93			273	C	XX 1 L
VERSION				274	AST	XX 1 MU		_AST_VERSION

# sys/systeminfo sysinfo additions

ARCHITECTURE			276	SVID	SI 1 0
BUSTYPES			277	SVID	SI 1 0
HOSTNAME			278	SVID	SI 1 0
HW_PROVIDER			279	SVID	SI 1 0
HW_SERIAL			280	SVID	SI 1 0
INITTAB_NAME			281	SVID	SI 1 0
KERNEL_STAMP			282	SVID	SI 1 0
MACHINE				283	SVID	SI 1 0
OS_BASE				284	SVID	SI 1 0
OS_PROVIDER			285	SVID	SI 1 0
RELEASE				286	SVID	SI 1 0
SRPC_DOMAIN			287	SVID	SI 1 0
SYSNAME				288	SVID	SI 1 0
USER_LIMIT			289	SVID	SI 1 0
VERSION				290	SVID	SI 1 0

# 291 is the next index #
