summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-09 11:45:37 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-09 11:45:37 -0600
commite9de57c22ec7de6c148bab3fefa54584a6039ab8 (patch)
tree89fee1a1df9783e5bd07f8fe1aa60fb1a4ef6617
parentb87ab558c6082608dbee68f9a2219bb5fbeee86d (diff)
downloadshimmy-e9de57c22ec7de6c148bab3fefa54584a6039ab8.tar.gz
shimmy-e9de57c22ec7de6c148bab3fefa54584a6039ab8.tar.bz2
shimmy-e9de57c22ec7de6c148bab3fefa54584a6039ab8.tar.xz
shimmy-e9de57c22ec7de6c148bab3fefa54584a6039ab8.zip
getconf(1): Add _NPROCESSORS_ONLN variable on supported systems
-rw-r--r--getconf/getconf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/getconf/getconf.c b/getconf/getconf.c
index 01265f1..fc707c6 100644
--- a/getconf/getconf.c
+++ b/getconf/getconf.c
@@ -322,6 +322,11 @@ const var_map_t sysconf_vars[] = {
#else /* NetBSD */
{ "_XOPEN_VERSION", _UNDEFINED_VARIABLE_ },
#endif
+#if defined(_SC_NPROCESSORS_ONLN)
+ { "_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN },
+#else /* only available on Linux, Solaris, AIX, Mac OS X */
+ { "_NPROCESSORS_ONLN", _UNDEFINED_VARIABLE_ },
+#endif
{ "POSIX2_LINE_MAX", SHIMMY_POSIX2_LINE_MAX },
{ "INT_MAX", SHIMMY_INT_MAX }