1*0a6a1f1dSLionel Sambuc /* $NetBSD: limits.h,v 1.34 2015/05/29 07:37:31 manu Exp $ */ 22fe8fb19SBen Gras 32fe8fb19SBen Gras /* 42fe8fb19SBen Gras * Copyright (c) 1988, 1993 52fe8fb19SBen Gras * The Regents of the University of California. All rights reserved. 62fe8fb19SBen Gras * 72fe8fb19SBen Gras * Redistribution and use in source and binary forms, with or without 82fe8fb19SBen Gras * modification, are permitted provided that the following conditions 92fe8fb19SBen Gras * are met: 102fe8fb19SBen Gras * 1. Redistributions of source code must retain the above copyright 112fe8fb19SBen Gras * notice, this list of conditions and the following disclaimer. 122fe8fb19SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 132fe8fb19SBen Gras * notice, this list of conditions and the following disclaimer in the 142fe8fb19SBen Gras * documentation and/or other materials provided with the distribution. 152fe8fb19SBen Gras * 3. Neither the name of the University nor the names of its contributors 162fe8fb19SBen Gras * may be used to endorse or promote products derived from this software 172fe8fb19SBen Gras * without specific prior written permission. 182fe8fb19SBen Gras * 192fe8fb19SBen Gras * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 202fe8fb19SBen Gras * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 212fe8fb19SBen Gras * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 222fe8fb19SBen Gras * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 232fe8fb19SBen Gras * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 242fe8fb19SBen Gras * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 252fe8fb19SBen Gras * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 262fe8fb19SBen Gras * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 272fe8fb19SBen Gras * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 282fe8fb19SBen Gras * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 292fe8fb19SBen Gras * SUCH DAMAGE. 302fe8fb19SBen Gras * 312fe8fb19SBen Gras * @(#)limits.h 8.2 (Berkeley) 1/4/94 329865aeaaSBen Gras */ 339865aeaaSBen Gras 342fe8fb19SBen Gras #ifndef _LIMITS_H_ 352fe8fb19SBen Gras #define _LIMITS_H_ 369865aeaaSBen Gras 372fe8fb19SBen Gras #include <sys/featuretest.h> 383eed5d3bSKees van Reeuwijk 392fe8fb19SBen Gras #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ 402fe8fb19SBen Gras defined(_NETBSD_SOURCE) 412fe8fb19SBen Gras #define _POSIX_AIO_LISTIO_MAX 2 422fe8fb19SBen Gras #define _POSIX_AIO_MAX 1 432fe8fb19SBen Gras #define _POSIX_ARG_MAX 4096 442fe8fb19SBen Gras #define _POSIX_CHILD_MAX 25 452fe8fb19SBen Gras #define _POSIX_HOST_NAME_MAX 255 462fe8fb19SBen Gras #define _POSIX_LINK_MAX 8 472fe8fb19SBen Gras #define _POSIX_LOGIN_NAME_MAX 9 482fe8fb19SBen Gras #define _POSIX_MAX_CANON 255 492fe8fb19SBen Gras #define _POSIX_MAX_INPUT 255 502fe8fb19SBen Gras #define _POSIX_MQ_OPEN_MAX 8 512fe8fb19SBen Gras #define _POSIX_MQ_PRIO_MAX 32 522fe8fb19SBen Gras #define _POSIX_NAME_MAX 14 532fe8fb19SBen Gras #define _POSIX_NGROUPS_MAX 8 542fe8fb19SBen Gras #define _POSIX_OPEN_MAX 20 552fe8fb19SBen Gras #define _POSIX_PATH_MAX 256 562fe8fb19SBen Gras #define _POSIX_PIPE_BUF 512 572fe8fb19SBen Gras #define _POSIX_RE_DUP_MAX 255 582fe8fb19SBen Gras #define _POSIX_SSIZE_MAX 32767 592fe8fb19SBen Gras #define _POSIX_STREAM_MAX 8 602fe8fb19SBen Gras #define _POSIX_SYMLINK_MAX 255 612fe8fb19SBen Gras #define _POSIX_SYMLOOP_MAX 8 62f14fb602SLionel Sambuc 63f14fb602SLionel Sambuc /* 64f14fb602SLionel Sambuc * We have not implemented these yet 65f14fb602SLionel Sambuc * 66f14fb602SLionel Sambuc * _POSIX_THREAD_ATTR_STACKADDR 67f14fb602SLionel Sambuc * _POSIX_THREAD_ATTR_STACKSIZE 68f14fb602SLionel Sambuc * _POSIX_THREAD_CPUTIME 69f14fb602SLionel Sambuc * _POSIX_THREAD_PRIORITY_SCHEDULING 70f14fb602SLionel Sambuc * _POSIX_THREAD_PRIO_INHERIT 71f14fb602SLionel Sambuc * _POSIX_THREAD_PRIO_PROTECT 72f14fb602SLionel Sambuc * _POSIX_THREAD_PROCESS_SHARED 73f14fb602SLionel Sambuc * _POSIX_THREAD_SAFE_FUNCTIONS 74f14fb602SLionel Sambuc * _POSIX_THREAD_SPORADIC_SERVER 75f14fb602SLionel Sambuc */ 76f14fb602SLionel Sambuc 77f14fb602SLionel Sambuc /* 78*0a6a1f1dSLionel Sambuc * The following 3 are defined in 79*0a6a1f1dSLionel Sambuc * Open Group Base Specifications Issue 7 80f14fb602SLionel Sambuc */ 812fe8fb19SBen Gras #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 82*0a6a1f1dSLionel Sambuc #define _POSIX_THREAD_KEYS_MAX 128 832fe8fb19SBen Gras #define _POSIX_THREAD_THREADS_MAX 64 84f14fb602SLionel Sambuc 85f14fb602SLionel Sambuc /* 86f14fb602SLionel Sambuc * These are the correct names, defined in terms of the above 87*0a6a1f1dSLionel Sambuc * except for PTHREAD_KEYS_MAX which is bigger than standard 88*0a6a1f1dSLionel Sambuc * mandated minimum value _POSIX_THREAD_KEYS_MAX. 89f14fb602SLionel Sambuc */ 90f14fb602SLionel Sambuc #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS 91*0a6a1f1dSLionel Sambuc #define PTHREAD_KEYS_MAX 256 92f14fb602SLionel Sambuc /* Not yet: PTHREAD_STACK_MIN */ 93f14fb602SLionel Sambuc #define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX 94f14fb602SLionel Sambuc 952fe8fb19SBen Gras #define _POSIX_TIMER_MAX 32 962fe8fb19SBen Gras #define _POSIX_TTY_NAME_MAX 9 972fe8fb19SBen Gras #define _POSIX_TZNAME_MAX 6 989865aeaaSBen Gras 992fe8fb19SBen Gras #define _POSIX2_BC_BASE_MAX 99 1002fe8fb19SBen Gras #define _POSIX2_BC_DIM_MAX 2048 1012fe8fb19SBen Gras #define _POSIX2_BC_SCALE_MAX 99 1022fe8fb19SBen Gras #define _POSIX2_BC_STRING_MAX 1000 1032fe8fb19SBen Gras #define _POSIX2_CHARCLASS_NAME_MAX 14 1042fe8fb19SBen Gras #define _POSIX2_COLL_WEIGHTS_MAX 2 1052fe8fb19SBen Gras #define _POSIX2_EXPR_NEST_MAX 32 1062fe8fb19SBen Gras #define _POSIX2_LINE_MAX 2048 1072fe8fb19SBen Gras #define _POSIX2_RE_DUP_MAX 255 1089865aeaaSBen Gras 1092fe8fb19SBen Gras /* 1102fe8fb19SBen Gras * X/Open CAE Specifications, 1112fe8fb19SBen Gras * adopted in IEEE Std 1003.1-2001 XSI. 1122fe8fb19SBen Gras */ 1132fe8fb19SBen Gras #if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_XOPEN_SOURCE) || \ 1142fe8fb19SBen Gras defined(_NETBSD_SOURCE) 1152fe8fb19SBen Gras #define _XOPEN_IOV_MAX 16 1162fe8fb19SBen Gras #define _XOPEN_NAME_MAX 256 1172fe8fb19SBen Gras #define _XOPEN_PATH_MAX 1024 1182fe8fb19SBen Gras 1192fe8fb19SBen Gras #define PASS_MAX 128 /* Legacy */ 1202fe8fb19SBen Gras 1212fe8fb19SBen Gras #define CHARCLASS_NAME_MAX 14 1222fe8fb19SBen Gras #define NL_ARGMAX 9 1232fe8fb19SBen Gras #define NL_LANGMAX 14 1242fe8fb19SBen Gras #define NL_MSGMAX 32767 1252fe8fb19SBen Gras #define NL_NMAX 1 1262fe8fb19SBen Gras #define NL_SETMAX 255 1272fe8fb19SBen Gras #define NL_TEXTMAX 2048 1282fe8fb19SBen Gras 1292fe8fb19SBen Gras /* IEEE Std 1003.1-2001 TSF */ 1302fe8fb19SBen Gras #define _GETGR_R_SIZE_MAX 1024 1312fe8fb19SBen Gras #define _GETPW_R_SIZE_MAX 1024 1322fe8fb19SBen Gras 1332fe8fb19SBen Gras /* Always ensure that this is consistent with <stdio.h> */ 1342fe8fb19SBen Gras #ifndef TMP_MAX 1352fe8fb19SBen Gras #define TMP_MAX 308915776 /* Legacy */ 1362fe8fb19SBen Gras #endif 1372fe8fb19SBen Gras #endif /* _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE || _NETBSD_SOURCE */ 1382fe8fb19SBen Gras 1392fe8fb19SBen Gras #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */ 1402fe8fb19SBen Gras 1412fe8fb19SBen Gras #define MB_LEN_MAX 32 /* Allow ISO/IEC 2022 */ 1422fe8fb19SBen Gras 143f14fb602SLionel Sambuc /* 144f14fb602SLionel Sambuc * X/Open Extended API set 2 (a.k.a. C063) 145f14fb602SLionel Sambuc * This hides unimplemented functions from GNU configure until 146f14fb602SLionel Sambuc * we are done implementing them. 147f14fb602SLionel Sambuc */ 148f14fb602SLionel Sambuc #if !defined(_INCOMPLETE_XOPEN_C063) 149f14fb602SLionel Sambuc #define __stub_fexecve 150f14fb602SLionel Sambuc #endif 151f14fb602SLionel Sambuc 1522fe8fb19SBen Gras #include <machine/limits.h> 153f14fb602SLionel Sambuc 154f14fb602SLionel Sambuc #ifdef __CHAR_UNSIGNED__ 155f14fb602SLionel Sambuc # define CHAR_MIN 0 156f14fb602SLionel Sambuc # define CHAR_MAX UCHAR_MAX 157f14fb602SLionel Sambuc #else 158f14fb602SLionel Sambuc # define CHAR_MIN SCHAR_MIN 159f14fb602SLionel Sambuc # define CHAR_MAX SCHAR_MAX 160f14fb602SLionel Sambuc #endif 1612fe8fb19SBen Gras 162f14fb602SLionel Sambuc #include <sys/syslimits.h> 1639865aeaaSBen Gras 1642fe8fb19SBen Gras #endif /* !_LIMITS_H_ */ 165