[hackers] [sbase] Use ifdef in getconf(1) instead of commenting out missing defines || FRIGN
commit b70d2857ab4b62256d6dfd659ea05706d2a8e7ec
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Sat Oct 31 17:26:29 2015 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Sun Nov 1 09:36:41 2015 +0000
Use ifdef in getconf(1) instead of commenting out missing defines
Thanks k0ga for the suggestion!
diff --git a/getconf.c b/getconf.c
index e21f002..5aa9b6c 100644
--- a/getconf.c
+++ b/getconf.c
_AT_@ -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[] = {
_AT_@ -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 },
};
_AT_@ -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 },
Received on Sun Nov 01 2015 - 10:36:46 CET
This archive was generated by hypermail 2.3.0
: Sun Nov 01 2015 - 10:48:13 CET