diff options
author | Stafford Horne <shorne@gmail.com> | 2017-12-14 15:21:00 +0900 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2017-12-16 21:06:06 +0100 |
commit | d8953ce923ec3bee1b0e4459e737e315472ec808 (patch) | |
tree | 818b82d96d1a4989abf681827ebd97d07728b948 /test/misc/tst-syscall1.c | |
parent | a710f82b67d690bf732f81ff652690d4b7b84d47 (diff) |
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 <shorne@gmail.com>
Diffstat (limited to 'test/misc/tst-syscall1.c')
-rw-r--r-- | test/misc/tst-syscall1.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 <stdio.h> +#include <unistd.h> +#include <sys/syscall.h> +#include <sys/utsname.h> + +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; +} |