132032Ssteve/*-
21539Srgrimes * Copyright (c) 1988, 1993
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
13203964Simp * 3. Neither the name of the University nor the names of its contributors
141539Srgrimes *    may be used to endorse or promote products derived from this software
151539Srgrimes *    without specific prior written permission.
161539Srgrimes *
171539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271539Srgrimes * SUCH DAMAGE.
281539Srgrimes *
291539Srgrimes *	@(#)limits.h	8.2 (Berkeley) 1/4/94
3050473Speter * $FreeBSD$
311539Srgrimes */
321539Srgrimes
331539Srgrimes#ifndef _LIMITS_H_
341539Srgrimes#define	_LIMITS_H_
35103762Sbde
36103727Swollman#include <sys/cdefs.h>
371539Srgrimes
38103727Swollman#if __POSIX_VISIBLE
391539Srgrimes#define	_POSIX_ARG_MAX		4096
401539Srgrimes#define	_POSIX_LINK_MAX		8
411539Srgrimes#define	_POSIX_MAX_CANON	255
421539Srgrimes#define	_POSIX_MAX_INPUT	255
431539Srgrimes#define	_POSIX_NAME_MAX		14
44219256Sjilles#define	_POSIX_PIPE_BUF		512
45219256Sjilles#define	_POSIX_SSIZE_MAX	32767
46219256Sjilles#define	_POSIX_STREAM_MAX	8
47219256Sjilles
48219256Sjilles#if __POSIX_VISIBLE >= 200112
49219256Sjilles#define	_POSIX_CHILD_MAX	25
50106055Swollman#define	_POSIX_NGROUPS_MAX	8
51106055Swollman#define	_POSIX_OPEN_MAX		20
52106055Swollman#define	_POSIX_PATH_MAX		256
53106055Swollman#define	_POSIX_TZNAME_MAX	6
54219256Sjilles#else
55219256Sjilles#define	_POSIX_CHILD_MAX	6
56219256Sjilles#define	_POSIX_NGROUPS_MAX	0
57219256Sjilles#define	_POSIX_OPEN_MAX		16
58219256Sjilles#define	_POSIX_PATH_MAX		255
59219256Sjilles#define	_POSIX_TZNAME_MAX	3
60219256Sjilles#endif
611539Srgrimes
62106055Swollman#define	BC_BASE_MAX		   99	/* max ibase/obase values in bc(1) */
63106055Swollman#define	BC_DIM_MAX		 2048	/* max array elements in bc(1) */
64106055Swollman#define	BC_SCALE_MAX		   99	/* max scale value in bc(1) */
65106055Swollman#define	BC_STRING_MAX		 1000	/* max const string length in bc(1) */
66106055Swollman#define	COLL_WEIGHTS_MAX	    0	/* max weights for order keyword */
67106055Swollman#define	EXPR_NEST_MAX		   32	/* max expressions nested in expr(1) */
68106055Swollman#define	LINE_MAX		 2048	/* max bytes in an input line */
69106055Swollman#define	RE_DUP_MAX		  255	/* max RE's in interval notation */
70106055Swollman
711539Srgrimes#define	_POSIX2_BC_BASE_MAX	99
721539Srgrimes#define	_POSIX2_BC_DIM_MAX	2048
731539Srgrimes#define	_POSIX2_BC_SCALE_MAX	99
741539Srgrimes#define	_POSIX2_BC_STRING_MAX	1000
751539Srgrimes#define	_POSIX2_EQUIV_CLASS_MAX	2
761539Srgrimes#define	_POSIX2_EXPR_NEST_MAX	32
771539Srgrimes#define	_POSIX2_LINE_MAX	2048
781539Srgrimes#define	_POSIX2_RE_DUP_MAX	255
79103727Swollman#endif
8034030Sdufault
81103727Swollman#if __POSIX_VISIBLE >= 199309
82211980Sjilles#define	_POSIX_AIO_LISTIO_MAX	2
83103762Sbde#define	_POSIX_AIO_MAX		1
84103762Sbde#define	_POSIX_DELAYTIMER_MAX	32
85103762Sbde#define	_POSIX_MQ_OPEN_MAX	8
86103762Sbde#define	_POSIX_MQ_PRIO_MAX	32
87106055Swollman#define	_POSIX_RTSIG_MAX	8
88103762Sbde#define	_POSIX_SEM_NSEMS_MAX	256
89103762Sbde#define	_POSIX_SEM_VALUE_MAX	32767
90103762Sbde#define	_POSIX_SIGQUEUE_MAX	32
91103762Sbde#define	_POSIX_TIMER_MAX	32
92219256Sjilles
93219256Sjilles#define	_POSIX_CLOCKRES_MIN	20000000
94103727Swollman#endif
9534030Sdufault
96106055Swollman#if __POSIX_VISIBLE >= 199506
97106055Swollman#define	_POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
98106055Swollman#define	_POSIX_THREAD_KEYS_MAX	128
99106055Swollman#define	_POSIX_THREAD_THREADS_MAX 64
100106055Swollman#endif
101106055Swollman
102103727Swollman#if __POSIX_VISIBLE >= 200112
103103727Swollman#define	_POSIX_HOST_NAME_MAX	255
104106055Swollman#define	_POSIX_LOGIN_NAME_MAX	9
105106055Swollman#define	_POSIX_SS_REPL_MAX	4
106106055Swollman#define	_POSIX_SYMLINK_MAX	255
107106055Swollman#define	_POSIX_SYMLOOP_MAX	8
108106055Swollman#define	_POSIX_TRACE_EVENT_NAME_MAX 30
109106055Swollman#define	_POSIX_TRACE_NAME_MAX	8
110106055Swollman#define	_POSIX_TRACE_SYS_MAX	8
111106055Swollman#define	_POSIX_TRACE_USER_EVENT_MAX 32
112106055Swollman#define	_POSIX_TTY_NAME_MAX	9
113106055Swollman#define	_POSIX2_CHARCLASS_NAME_MAX 14
114106055Swollman#define	_POSIX2_COLL_WEIGHTS_MAX 2
115106055Swollman
116106055Swollman#define	_POSIX_RE_DUP_MAX	_POSIX2_RE_DUP_MAX
11734030Sdufault#endif
11834030Sdufault
119219271Sjilles#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
120219271Sjilles#define	NL_ARGMAX		99	/* max # of position args for printf */
121219271Sjilles#define	NL_MSGMAX		32767
122219271Sjilles#define	NL_SETMAX		255
123219271Sjilles#define	NL_TEXTMAX		2048
124219271Sjilles#endif
125219271Sjilles
126103727Swollman#if __XSI_VISIBLE
127103727Swollman#define	_XOPEN_IOV_MAX		16
128106055Swollman#define	_XOPEN_NAME_MAX		255
129106055Swollman#define	_XOPEN_PATH_MAX		1024
130103762Sbde#define	PASS_MAX		128	/* _PASSWORD_LEN from <pwd.h> */
13121759Sache
132103762Sbde#define	NL_LANGMAX		31	/* max LANG name length */
133103762Sbde#define	NL_NMAX			1
134103762Sbde#endif
13521759Sache
136108175Stjr#define	MB_LEN_MAX		6	/* 31-bit UTF-8 */
137108175Stjr
138114216Skan#include <sys/limits.h>
139103762Sbde
140103727Swollman#if __POSIX_VISIBLE
1411539Srgrimes#include <sys/syslimits.h>
14232032Ssteve#endif
1431539Srgrimes
1441539Srgrimes#endif /* !_LIMITS_H_ */
145