limits.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _LIMITS_H
#define _LIMITS_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.34 */
#include <sys/feature_tests.h>
#include <sys/isa_defs.h>
#include <iso/limits_iso.h>
/*
* committee's working draft for the revision of the current ISO C standard,
* required by any standard but constitute a useful, general purpose set
* of type definitions and limits which is namespace clean with respect to
* all standards.
*/
#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
defined(__XOPEN_OR_POSIX)
#include <sys/int_limits.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
defined(__XOPEN_OR_POSIX)
/*
* ARG_MAX is calculated as follows:
* NCARGS - space for other stuff on initial stack
* like aux vectors, saved registers, etc..
*/
#ifdef _LP64
#else /* _LP64 */
#endif /* _LP64 */
#ifndef MAX_CANON
#endif
#ifndef MAX_INPUT
#endif
#ifndef PATH_MAX
#endif
#ifndef TMP_MAX
#endif
/*
* POSIX conformant definitions - An implementation may define
* other symbols which reflect the actual implementation. Alternate
* definitions may not be as restrictive as the POSIX definitions.
*/
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_MAX 1
#define _POSIX_ARG_MAX 4096
#ifdef _XPG6
#define _POSIX_CHILD_MAX 25
#else
#endif
#define _POSIX_CLOCKRES_MIN 20000000
#define _POSIX_DELAYTIMER_MAX 32
#define _POSIX_LINK_MAX 8
#define _POSIX_MAX_CANON 255
#define _POSIX_MAX_INPUT 255
#define _POSIX_MQ_OPEN_MAX 8
#define _POSIX_MQ_PRIO_MAX 32
#define _POSIX_NAME_MAX 14
#ifdef _XPG6
#define _POSIX_NGROUPS_MAX 8
#define _POSIX_OPEN_MAX 20
#define _POSIX_PATH_MAX 256
#else /* POSIX.1-1990 defaults */
#define _POSIX_NGROUPS_MAX 0
#define _POSIX_OPEN_MAX 16
#define _POSIX_PATH_MAX 255
#endif
#define _POSIX_PIPE_BUF 512
#define _POSIX_RTSIG_MAX 8
#define _POSIX_SEM_NSEMS_MAX 256
#define _POSIX_SEM_VALUE_MAX 32767
#define _POSIX_SIGQUEUE_MAX 32
#define _POSIX_SSIZE_MAX 32767
#define _POSIX_STREAM_MAX 8
#define _POSIX_TIMER_MAX 32
#ifdef _XPG6
#define _POSIX_TZNAME_MAX 6
#else
#endif
/* POSIX.1c conformant */
#define _POSIX_LOGIN_NAME_MAX 9
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_THREADS_MAX 64
#define _POSIX_TTY_NAME_MAX 9
/* UNIX 03 conformant */
#define _POSIX_HOST_NAME_MAX 255
#define _POSIX_RE_DUP_MAX 255
#define _POSIX_SYMLINK_MAX 255
#define _POSIX_SYMLOOP_MAX 8
/*
* POSIX.2 and XPG4-XSH4 conformant definitions
*/
#define _POSIX2_BC_BASE_MAX 99
#define _POSIX2_BC_DIM_MAX 2048
#define _POSIX2_BC_SCALE_MAX 99
#define _POSIX2_BC_STRING_MAX 1000
#define _POSIX2_COLL_WEIGHTS_MAX 2
#define _POSIX2_EXPR_NEST_MAX 32
#define _POSIX2_LINE_MAX 2048
#define _POSIX2_RE_DUP_MAX 255
/* UNIX 03 conformant */
#define _POSIX2_CHARCLASS_NAME_MAX 14
#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
#define COLL_WEIGHTS_MAX 10
#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
#define LINE_MAX _POSIX2_LINE_MAX
#if !defined(_XPG6)
#define RE_DUP_MAX _POSIX2_RE_DUP_MAX
#else
#define RE_DUP_MAX _POSIX_RE_DUP_MAX
#endif /* !defined(_XPG6) */
#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
defined(_XOPEN_SOURCE)
/*
* For dual definitions for PASS_MAX and sysconf.c
*/
#else /* XPG6 or just Solaris */
#endif /* defined(_XPG3) && !defined(_XPG6) */
/* NLS printf() and scanf() */
#if defined(_LP64)
#else /* _ILP32 */
#endif
/* Marked as LEGACY in SUSv2 and removed in UNIX 03 */
#ifndef _XPG6
/* of a double */
/* of a "float" */
#endif
/* Marked as LEGACY in SUSv1 and removed in SUSv2 */
#ifndef _XPG5
/* of a double */
/* of a float */
#endif
#endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
#define IOV_MAX _XOPEN_IOV_MAX
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
/*
* POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
* related text states:
*
* A definition of one of the values from Table 2-5 shall be omitted from the
* <limits.h> on specific implementations where the corresponding value is
* equal to or greater than the stated minimum, but where the value can vary
* depending on the file to which it is applied. The actual value supported for
* a specific pathname shall be provided by the pathconf() (5.7.1) function.
*
* This is clear that any machine supporting multiple file system types
* by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
*
* #define NAME_MAX 14
*/
#ifndef OPEN_MAX
#endif
#endif
#ifndef CLK_TCK
#define _CLOCK_T
typedef long clock_t;
#endif /* !_CLOCK_T */
extern long _sysconf(int); /* System Private interface to sysconf() */
#endif /* CLK_TCK */
#endif /* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
/*
* POSIX.1c Note:
* PTHREAD_STACK_MIN is also defined in <pthread.h>.
*/
#define _SIZE_T
typedef unsigned long size_t; /* size of something in bytes */
#else
typedef unsigned int size_t; /* (historical version) */
#endif
#endif /* _SIZE_T */
extern long _sysconf(int); /* System Private interface to sysconf() */
/* Added for UNIX98 conformance */
#endif /* defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L) */
#ifdef __cplusplus
}
#endif
#endif /* _LIMITS_H */