aboutsummaryrefslogtreecommitdiff
path: root/libbb/sysconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/sysconf.c')
-rw-r--r--libbb/sysconf.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libbb/sysconf.c b/libbb/sysconf.c
new file mode 100644
index 000000000..031901980
--- /dev/null
+++ b/libbb/sysconf.c
@@ -0,0 +1,22 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Various system configuration helpers.
4 *
5 * Copyright (C) 2014 Bartosz Golaszewski <bartekgola@gmail.com>
6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */
9#include "libbb.h"
10
11#if !defined(ARG_MAX) && defined(_SC_ARG_MAX)
12unsigned FAST_FUNC bb_arg_max(void)
13{
14 return sysconf(_SC_ARG_MAX);
15}
16#endif
17
18/* Return the number of clock ticks per second. */
19unsigned FAST_FUNC bb_clk_tck(void)
20{
21 return sysconf(_SC_CLK_TCK);
22}