sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit b70d2857ab4b62256d6dfd659ea05706d2a8e7ec
parent 9b7e560781062288b2f26a4d3f920c604b4334d4
Author: FRIGN <dev@frign.de>
Date:   Sat Oct 31 17:26:29 +0100

Use ifdef in getconf(1) instead of commenting out missing defines

Thanks k0ga for the suggestion!

Diffstat:
getconf.c | 56++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 42 insertions(+), 14 deletions(-)
diff --git a/getconf.c b/getconf.c @@ -33,7 +33,9 @@ static const struct var pathconf_l[] = { { "_POSIX_ASYNC_IO", _PC_ASYNC_IO }, { "_POSIX_PRIO_IO", _PC_PRIO_IO }, { "_POSIX_SYNC_IO", _PC_SYNC_IO }, - /*{ "_POSIX_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION },*/ +#ifdef _PC_TIMESTAMP_RESOLUTION + { "_POSIX_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION }, +#endif }; static const struct var sysconf_l[] = { @@ -153,7 +155,9 @@ static const struct var sysconf_l[] = { { "_XOPEN_SHM", _SC_XOPEN_SHM }, { "_XOPEN_STREAMS", _SC_XOPEN_STREAMS }, { "_XOPEN_UNIX", _SC_XOPEN_UNIX }, - /*{ "_XOPEN_UUCP", _SC_XOPEN_UUCP },*/ +#ifdef _SC_XOPEN_UUCP + { "_XOPEN_UUCP", _SC_XOPEN_UUCP }, +#endif { "_XOPEN_VERSION", _SC_XOPEN_VERSION }, }; @@ -171,45 +175,69 @@ static const struct var confstr_l[] = { { "POSIX_V7_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS }, { "POSIX_V7_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS }, { "POSIX_V7_LPBIG_OFFBIG_LIBS", _CS_POSIX_V7_LPBIG_OFFBIG_LIBS }, - /*{ "POSIX_V7_THREADS_CFLAGS", _CS_POSIX_V7_THREADS_CFLAGS },*/ - /*{ "POSIX_V7_THREADS_LDFLAGS", _CS_POSIX_V7_THREADS_LDFLAGS },*/ +#ifdef _CS_POSIX_V7_THREADS_CFLAGS + { "POSIX_V7_THREADS_CFLAGS", _CS_POSIX_V7_THREADS_CFLAGS }, +#endif +#ifdef _CS_POSIX_V7_THREADS_LDFLAGS + { "POSIX_V7_THREADS_LDFLAGS", _CS_POSIX_V7_THREADS_LDFLAGS }, +#endif { "POSIX_V7_WIDTH_RESTRICTED_ENVS", _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS }, - /*{ "V7_ENV", _CS_V7_ENV },*/ +#ifdef _CS_V7_ENV + { "V7_ENV", _CS_V7_ENV }, +#endif }; static const struct var limits_l[] = { { "_POSIX_CLOCKRES_MIN", _POSIX_CLOCKRES_MIN }, - /*{ "_POSIX_AIO_LISTIO_MAX", _POSIX_AIO_LISTIO_MAX },*/ - /*{ "_POSIX_AIO_MAX", _POSIX_AIO_MAX },*/ +#ifdef _POSIX_AIO_LISTIO_MAX + { "_POSIX_AIO_LISTIO_MAX", _POSIX_AIO_LISTIO_MAX }, +#endif +#ifdef _POSIX_AIO_MAX + { "_POSIX_AIO_MAX", _POSIX_AIO_MAX }, +#endif { "_POSIX_ARG_MAX", _POSIX_ARG_MAX }, { "_POSIX_CHILD_MAX", _POSIX_CHILD_MAX }, - /*{ "_POSIX_DELAYTIMER_MAX", _POSIX_DELAYTIMER_MAX },*/ +#ifdef _POSIX_DELAYTIMER_MAX + { "_POSIX_DELAYTIMER_MAX", _POSIX_DELAYTIMER_MAX }, +#endif { "_POSIX_HOST_NAME_MAX", _POSIX_HOST_NAME_MAX }, { "_POSIX_LINK_MAX", _POSIX_LINK_MAX }, { "_POSIX_LOGIN_NAME_MAX", _POSIX_LOGIN_NAME_MAX }, { "_POSIX_MAX_CANON", _POSIX_MAX_CANON }, { "_POSIX_MAX_INPUT", _POSIX_MAX_INPUT }, - /*{ "_POSIX_MQ_OPEN_MAX", _POSIX_MQ_OPEN_MAX },*/ - /*{ "_POSIX_MQ_PRIO_MAX", _POSIX_MQ_PRIO_MAX },*/ +#ifdef _POSIX_MQ_OPEN_MAX + { "_POSIX_MQ_OPEN_MAX", _POSIX_MQ_OPEN_MAX }, +#endif +#ifdef _POSIX_MQ_PRIO_MAX + { "_POSIX_MQ_PRIO_MAX", _POSIX_MQ_PRIO_MAX }, +#endif { "_POSIX_NAME_MAX", _POSIX_NAME_MAX }, { "_POSIX_NGROUPS_MAX", _POSIX_NGROUPS_MAX }, { "_POSIX_OPEN_MAX", _POSIX_OPEN_MAX }, { "_POSIX_PATH_MAX", _POSIX_PATH_MAX }, { "_POSIX_PIPE_BUF", _POSIX_PIPE_BUF }, { "_POSIX_RE_DUP_MAX", _POSIX_RE_DUP_MAX }, - /*{ "_POSIX_RTSIG_MAX", _POSIX_RTSIG_MAX },*/ +#ifdef _POSIX_RTSIG_MAX + { "_POSIX_RTSIG_MAX", _POSIX_RTSIG_MAX }, +#endif { "_POSIX_SEM_NSEMS_MAX", _POSIX_SEM_NSEMS_MAX }, { "_POSIX_SEM_VALUE_MAX", _POSIX_SEM_VALUE_MAX }, - /*{ "_POSIX_SIGQUEUE_MAX", _POSIX_SIGQUEUE_MAX },*/ +#ifdef _POSIX_SIGQUEUE_MAX + { "_POSIX_SIGQUEUE_MAX", _POSIX_SIGQUEUE_MAX }, +#endif { "_POSIX_SSIZE_MAX", _POSIX_SSIZE_MAX }, - /*{ "_POSIX_SS_REPL_MAX", _POSIX_SS_REPL_MAX },*/ +#ifdef _POSIX_SS_REPL_MAX + { "_POSIX_SS_REPL_MAX", _POSIX_SS_REPL_MAX }, +#endif { "_POSIX_STREAM_MAX", _POSIX_STREAM_MAX }, { "_POSIX_SYMLINK_MAX", _POSIX_SYMLINK_MAX }, { "_POSIX_SYMLOOP_MAX", _POSIX_SYMLOOP_MAX }, { "_POSIX_THREAD_DESTRUCTOR_ITERATIONS", _POSIX_THREAD_DESTRUCTOR_ITERATIONS }, { "_POSIX_THREAD_KEYS_MAX", _POSIX_THREAD_KEYS_MAX }, { "_POSIX_THREAD_THREADS_MAX", _POSIX_THREAD_THREADS_MAX }, - /*{ "_POSIX_TIMER_MAX", _POSIX_TIMER_MAX },*/ +#ifdef _POSIX_TIMER_MAX + { "_POSIX_TIMER_MAX", _POSIX_TIMER_MAX }, +#endif { "_POSIX_TTY_NAME_MAX", _POSIX_TTY_NAME_MAX }, { "_POSIX_TZNAME_MAX", _POSIX_TZNAME_MAX }, { "_POSIX2_BC_BASE_MAX", _POSIX2_BC_BASE_MAX },