From d8953ce923ec3bee1b0e4459e737e315472ec808 Mon Sep 17 00:00:00 2001 From: Stafford Horne Date: Thu, 14 Dec 2017 15:21:00 +0900 Subject: tst-syscall*: Add tests for syscall() with varargs Add tests in preparation for genericizing some of the architecture syscall() implementations. This was noticed when testing OR1K and found it had a broken syscall implementation. These tests try to cover the libc syscall() lqyer which has the purpose of passing the syscall number and arguments to the kernel. The actual kernel syscalls chosen have been selected for ease of testing. Signed-off-by: Stafford Horne --- test/misc/tst-syscall1.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/misc/tst-syscall1.c (limited to 'test/misc/tst-syscall1.c') diff --git a/test/misc/tst-syscall1.c b/test/misc/tst-syscall1.c new file mode 100644 index 0000000..e3b990e --- /dev/null +++ b/test/misc/tst-syscall1.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +int main() { + int ret; + struct utsname name; + + ret = syscall(SYS_uname, &name); + if (ret == 0) { + printf("syscall(SYS_uname) says %s-%s\n", name.sysname, + name.release); + return 0; + } + + return 1; +} -- cgit v1.2.3