2015-01-20 14:09:50 -08:00
|
|
|
/* $OpenBSD: limits.h,v 1.19 2015/01/20 22:09:50 tedu Exp $ */
|
1995-10-18 01:37:01 -07:00
|
|
|
/* $NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $ */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1988 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-06-02 12:34:12 -07:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1995-10-18 01:37:01 -07:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* @(#)limits.h 5.9 (Berkeley) 4/3/91
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LIMITS_H_
|
|
|
|
#define _LIMITS_H_
|
|
|
|
|
2005-12-12 16:35:22 -08:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
|
|
#if __POSIX_VISIBLE
|
1996-10-25 20:12:45 -07:00
|
|
|
#define _POSIX_ARG_MAX 4096
|
2004-05-31 11:31:52 -07:00
|
|
|
#define _POSIX_CHILD_MAX 25
|
1995-10-18 01:37:01 -07:00
|
|
|
#define _POSIX_LINK_MAX 8
|
|
|
|
#define _POSIX_MAX_CANON 255
|
|
|
|
#define _POSIX_MAX_INPUT 255
|
|
|
|
#define _POSIX_NAME_MAX 14
|
2004-06-09 10:32:10 -07:00
|
|
|
#define _POSIX_PATH_MAX 256
|
1995-10-18 01:37:01 -07:00
|
|
|
#define _POSIX_PIPE_BUF 512
|
2004-05-31 11:31:52 -07:00
|
|
|
#define _POSIX_RE_DUP_MAX 255
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#define _POSIX_SEM_NSEMS_MAX 256
|
|
|
|
#define _POSIX_SEM_VALUE_MAX 32767
|
1996-10-25 20:12:45 -07:00
|
|
|
#define _POSIX_SSIZE_MAX 32767
|
1995-10-18 01:37:01 -07:00
|
|
|
#define _POSIX_STREAM_MAX 8
|
2004-06-09 10:32:10 -07:00
|
|
|
#define _POSIX_SYMLINK_MAX 255
|
2004-05-31 11:31:52 -07:00
|
|
|
#define _POSIX_SYMLOOP_MAX 8
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
|
|
|
#define _POSIX_THREAD_KEYS_MAX 128
|
|
|
|
#define _POSIX_THREAD_THREADS_MAX 4
|
|
|
|
|
2008-02-10 01:59:54 -08:00
|
|
|
#if __POSIX_VISIBLE >= 200112
|
2013-03-01 13:16:34 -08:00
|
|
|
#define _POSIX_CLOCKRES_MIN 20000000
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#define _POSIX_NGROUPS_MAX 8
|
|
|
|
#define _POSIX_OPEN_MAX 20
|
2013-03-01 13:16:34 -08:00
|
|
|
#define _POSIX_TZNAME_MAX 6
|
2008-02-10 01:59:54 -08:00
|
|
|
#else
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#define _POSIX_NGROUPS_MAX 0
|
|
|
|
#define _POSIX_OPEN_MAX 16
|
2013-03-01 13:16:34 -08:00
|
|
|
#define _POSIX_TZNAME_MAX 3
|
2008-02-10 01:59:54 -08:00
|
|
|
#endif
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2013-03-01 13:16:34 -08:00
|
|
|
#define _POSIX2_BC_BASE_MAX 99
|
|
|
|
#define _POSIX2_BC_DIM_MAX 2048
|
|
|
|
#define _POSIX2_BC_SCALE_MAX 99
|
|
|
|
#define _POSIX2_BC_STRING_MAX 1000
|
1995-10-18 01:37:01 -07:00
|
|
|
#define _POSIX2_COLL_WEIGHTS_MAX 2
|
2013-03-01 13:16:34 -08:00
|
|
|
#define _POSIX2_EXPR_NEST_MAX 32
|
|
|
|
#define _POSIX2_LINE_MAX 2048
|
|
|
|
#define _POSIX2_RE_DUP_MAX _POSIX_RE_DUP_MAX
|
|
|
|
#define _POSIX2_CHARCLASS_NAME_MAX 14
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2005-12-12 16:35:22 -08:00
|
|
|
#if __POSIX_VISIBLE >= 200112
|
2008-02-02 07:31:31 -08:00
|
|
|
#define _POSIX_HOST_NAME_MAX 255
|
2005-12-31 11:29:38 -08:00
|
|
|
#define _POSIX_LOGIN_NAME_MAX 9 /* includes trailing NUL */
|
2008-02-02 07:31:31 -08:00
|
|
|
#define _POSIX_TTY_NAME_MAX 9 /* includes trailing NUL */
|
2005-12-31 11:29:38 -08:00
|
|
|
#endif /* __POSIX_VISIBLE >= 200112 */
|
2005-12-12 16:35:22 -08:00
|
|
|
#endif /* __POSIX_VISIBLE */
|
|
|
|
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#if __XPG_VISIBLE || __POSIX_VISIBLE >= 200809
|
1995-10-18 01:37:01 -07:00
|
|
|
#define NL_ARGMAX 9
|
|
|
|
#define NL_LANGMAX 14
|
|
|
|
#define NL_MSGMAX 32767
|
|
|
|
#define NL_SETMAX 255
|
|
|
|
#define NL_TEXTMAX 255
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#endif
|
|
|
|
|
2013-02-17 14:09:54 -08:00
|
|
|
#if __XPG_VISIBLE
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
# if __XPG_VISIBLE < 600
|
|
|
|
# define PASS_MAX 128 /* _PASSWORD_LEN from <pwd.h> */
|
2015-01-20 14:09:50 -08:00
|
|
|
# define TMP_MAX 0x7fffffff /* more, but don't overflow int */
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
# endif
|
|
|
|
|
|
|
|
# if __XPG_VISIBLE < 700
|
|
|
|
# define NL_NMAX 1
|
|
|
|
# endif
|
1998-07-10 23:02:44 -07:00
|
|
|
|
Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.
ok kettenis@
2012-06-30 13:21:10 -07:00
|
|
|
#define _XOPEN_IOV_MAX 16
|
|
|
|
#define _XOPEN_NAME_MAX 255
|
|
|
|
#define _XOPEN_PATH_MAX 1024
|
2005-12-12 16:35:22 -08:00
|
|
|
#endif /* __XPG_VISIBLE */
|
1998-11-20 03:18:22 -08:00
|
|
|
|
Introduce a new file, machine/internal_types.h, to hold that specific arch
type characteristics.
internal_types.h will contain only settings invisible from standard C, e.g.,
in the __* or _[A-Z]* namespace, and be reused by files like limits.h.
This allows us to shorten machine/limits.h greatly, as all the common defines
are now in sys/limits.h, plus a small stub in internal_types.h.
Tested on all arches as far as I know.
Approved after discussion with art, millert, deraadt, and others.
2002-04-24 14:53:11 -07:00
|
|
|
#include <sys/limits.h>
|
2005-12-12 16:35:22 -08:00
|
|
|
|
|
|
|
#if __POSIX_VISIBLE
|
1995-10-18 01:37:01 -07:00
|
|
|
#include <sys/syslimits.h>
|
2005-12-12 16:35:22 -08:00
|
|
|
#endif
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
#endif /* !_LIMITS_H_ */
|