From: Fei Jie Date: Tue, 19 Apr 2016 07:38:33 +0000 (+0800) Subject: tests: add iopl.test X-Git-Tag: v4.12~392 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1eb00516637c3f2dfdf7ac3491432dbccdc8a023;p=strace tests: add iopl.test * tests/iopl.c: New file. * tests/iopl.test: New test. * tests/.gitignore: Add iopl. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add iopl.test. --- diff --git a/tests/.gitignore b/tests/.gitignore index c2bc5add..1b2a422b 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -67,6 +67,7 @@ getxxid inet-cmsg ioctl ioperm +iopl ip_mreq ipc_msg ipc_msgbuf diff --git a/tests/Makefile.am b/tests/Makefile.am index 047ac608..8be33758 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -119,6 +119,7 @@ check_PROGRAMS = \ inet-cmsg \ ioctl \ ioperm \ + iopl \ ip_mreq \ ipc_msg \ ipc_msgbuf \ @@ -353,6 +354,7 @@ DECODER_TESTS = \ inet-cmsg.test \ ioctl.test \ ioperm.test \ + iopl.test \ ip_mreq.test \ ipc_msg.test \ ipc_msgbuf.test \ diff --git a/tests/iopl.c b/tests/iopl.c new file mode 100644 index 00000000..3d379d42 --- /dev/null +++ b/tests/iopl.c @@ -0,0 +1,35 @@ +#include "tests.h" +#include + +#ifdef __NR_iopl + +# include +# include +# include + +int +main(void) +{ + long rc = syscall(__NR_iopl, 4); + const char *error_text; + switch (errno) { + case ENOSYS: + error_text = "ENOSYS"; + break; + case EPERM: + error_text = "EPERM"; + break; + default: + error_text = "EINVAL"; + } + printf("iopl(4) = %ld %s (%m)\n", rc, error_text); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_iopl") + +#endif diff --git a/tests/iopl.test b/tests/iopl.test new file mode 100755 index 00000000..d0b5b113 --- /dev/null +++ b/tests/iopl.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check iopl syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8