aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2020-07-25 22:46:16 +0100
committerBen Hutchings <ben@decadent.org.uk>2020-07-25 22:51:45 +0100
commit3df6e74ab78fc63aa025d07fb849ec9508cbf1c2 (patch)
tree1b69c1fe04be7858b421fe530df986e95aee098e
parenteec6f35f6375ad3a6ddc784b2e149cf55181e14e (diff)
downloadklibc-3df6e74ab78fc63aa025d07fb849ec9508cbf1c2.tar.gz
[klibc] tests: Add a trivial test for sysconf()
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--usr/klibc/tests/Kbuild1
-rw-r--r--usr/klibc/tests/sysconf.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild
index c7ca531f726db4..00b701fc46317b 100644
--- a/usr/klibc/tests/Kbuild
+++ b/usr/klibc/tests/Kbuild
@@ -45,6 +45,7 @@ stdio.shared-y := stdio.o
strlcpycat.shared-y := strlcpycat.o
strtoimax.shared-y := strtoimax.o
strtotime.shared-y := strtotime.o
+sysconf.shared-y := sysconf.o
testrand48.shared-y := testrand48.o
testvsnp.shared-y := testvsnp.o
vfork.shared-y := vfork.o
diff --git a/usr/klibc/tests/sysconf.c b/usr/klibc/tests/sysconf.c
new file mode 100644
index 00000000000000..e32c1383ec1dcd
--- /dev/null
+++ b/usr/klibc/tests/sysconf.c
@@ -0,0 +1,14 @@
+#include <assert.h>
+#include <stdio.h>
+#include <sys/sysconf.h>
+
+int main(void)
+{
+ long rc;
+
+ rc = sysconf(_SC_PAGESIZE);
+ assert(rc > 0);
+ printf("sysconf(_SC_PAGESIZE) = %ld\n", rc);
+
+ return 0;
+}