/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <errno.h>
#include <error.h>
#include <libintl.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "../version.h"
#define PACKAGE _libc_intl_domainname
#define NEED_SPEC_ARRAY 1
#include <posix-conf-vars.h>
/* If all of the environments are defined in environments.h, then we don't need
to bother with doing a runtime check for a specific environment. */
#if (defined _SC_V6_ILP32_OFF32 \
&& defined _SC_V7_LPBIG_OFFBIG \
&& defined _SC_XBS5_LP64_OFF64 \
&& defined _SC_V6_LP64_OFF64 \
&& defined _SC_V7_ILP32_OFFBIG \
&& defined _SC_V6_LPBIG_OFFBIG \
&& defined _SC_V7_LP64_OFF64 \
&& defined _SC_V7_ILP32_OFF32 \
&& defined _SC_XBS5_LPBIG_OFFBIG \
&& defined _SC_XBS5_ILP32_OFFBIG \
&& defined _SC_V6_ILP32_OFFBIG \
&& defined _SC_XBS5_ILP32_OFF32)
# define ALL_ENVIRONMENTS_DEFINED 1
#endif
struct conf
{
const char *name;
const int call_name;
const enum { SYSCONF, CONFSTR, PATHCONF } call;
};
static const struct conf vars[] =
{
{ "LINK_MAX", _PC_LINK_MAX, PATHCONF },
{ "_POSIX_LINK_MAX", _PC_LINK_MAX, PATHCONF },
{ "MAX_CANON", _PC_MAX_CANON, PATHCONF },
{ "_POSIX_MAX_CANON", _PC_MAX_CANON, PATHCONF },
{ "MAX_INPUT", _PC_MAX_INPUT, PATHCONF },
{ "_POSIX_MAX_INPUT", _PC_MAX_INPUT, PATHCONF },
{ "NAME_MAX", _PC_NAME_MAX, PATHCONF },
{ "_POSIX_NAME_MAX", _PC_NAME_MAX, PATHCONF },
{ "PATH_MAX", _PC_PATH_MAX, PATHCONF },
{ "_POSIX_PATH_MAX", _PC_PATH_MAX, PATHCONF },
{ "PIPE_BUF", _PC_PIPE_BUF, PATHCONF },
{ "_POSIX_PIPE_BUF", _PC_PIPE_BUF, PATHCONF },
{ "SOCK_MAXBUF", _PC_SOCK_MAXBUF, PATHCONF },
{ "_POSIX_ASYNC_IO", _PC_ASYNC_IO, PATHCONF },
{ "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED, PATHCONF },
{ "_POSIX_NO_TRUNC", _PC_NO_TRUNC, PATHCONF },
{ "_POSIX_PRIO_IO", _PC_PRIO_IO, PATHCONF },
{ "_POSIX_SYNC_IO", _PC_SYNC_IO, PATHCONF },
{ "_POSIX_VDISABLE", _PC_VDISABLE, PATHCONF },
{ "ARG_MAX", _SC_ARG_MAX, SYSCONF },
{ "ATEXIT_MAX", _SC_ATEXIT_MAX, SYSCONF },
{ "CHAR_BIT", _SC_CHAR_BIT, SYSCONF },
{ "CHAR_MAX", _SC_CHAR_MAX, SYSCONF },
{ "CHAR_MIN", _SC_CHAR_MIN, SYSCONF },
{ "CHILD_MAX", _SC_CHILD_MAX, SYSCONF },
{ "CLK_TCK", _SC_CLK_TCK, SYSCONF },
{ "INT_MAX"