[klibc] [klibc:master] tests: Add a trivial test for sysconf()

klibc-bot for Ben Hutchings ben at decadent.org.uk
Sat Jul 25 14:51:03 PDT 2020


Commit-ID:  eae5223098f32ba5cbb83631cec2579f764ee6ff
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=eae5223098f32ba5cbb83631cec2579f764ee6ff
Author:     Ben Hutchings <ben at decadent.org.uk>
AuthorDate: Sat, 25 Jul 2020 22:48:23 +0100
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 25 Jul 2020 22:48:23 +0100

[klibc] tests: Add a trivial test for sysconf()

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 usr/klibc/tests/sysconf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/usr/klibc/tests/sysconf.c b/usr/klibc/tests/sysconf.c
new file mode 100644
index 00000000..e32c1383
--- /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;
+}


More information about the klibc mailing list