summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/Kbuild.src1
-rw-r--r--libbb/sysconf.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index 6578d11..62680bd 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -92,6 +92,7 @@ lib-y += skip_whitespace.o
lib-y += speed_table.o
lib-y += str_tolower.o
lib-y += strrstr.o
+lib-y += sysconf.o
lib-y += time.o
lib-y += trim.o
lib-y += u_signal_names.o
diff --git a/libbb/sysconf.c b/libbb/sysconf.c
new file mode 100644
index 0000000..c5fa5e0
--- /dev/null
+++ b/libbb/sysconf.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Various system configuration helpers.
+ *
+ * Copyright (C) 2014 Bartosz Golaszewski <bartekgola@gmail.com>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+
+#if defined _SC_ARG_MAX
+unsigned FAST_FUNC bb_arg_max(void)
+{
+ return sysconf(_SC_ARG_MAX);
+}
+#endif