From cd61c9f3e490507521fcd92f8af0fe4073b978cc Mon Sep 17 00:00:00 2001 From: Fei Jie Date: Mon, 25 Apr 2016 16:18:20 +0800 Subject: [PATCH] tests: add sched_rr_get_interval.test * tests/sched_rr_get_interval.c: New file. * tests/sched_rr_get_interval.test: New test. * tests/.gitignore: Add sched_rr_get_interval. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add sched_rr_get_interval.test. --- tests/.gitignore | 1 + tests/Makefile.am | 2 ++ tests/sched_rr_get_interval.c | 26 ++++++++++++++++++++++++++ tests/sched_rr_get_interval.test | 6 ++++++ 4 files changed, 35 insertions(+) create mode 100644 tests/sched_rr_get_interval.c create mode 100755 tests/sched_rr_get_interval.test diff --git a/tests/.gitignore b/tests/.gitignore index 5b3cb430..df8b12f2 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -152,6 +152,7 @@ rt_sigsuspend rt_sigtimedwait rt_tgsigqueueinfo sched_get_priority_mxx +sched_rr_get_interval sched_xetaffinity sched_xetattr sched_xetparam diff --git a/tests/Makefile.am b/tests/Makefile.am index e16b327c..9dcbbb64 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -203,6 +203,7 @@ check_PROGRAMS = \ rt_sigtimedwait \ rt_tgsigqueueinfo \ sched_get_priority_mxx \ + sched_rr_get_interval \ sched_xetaffinity \ sched_xetattr \ sched_xetparam \ @@ -450,6 +451,7 @@ DECODER_TESTS = \ rt_sigtimedwait.test \ rt_tgsigqueueinfo.test \ sched_get_priority_mxx.test \ + sched_rr_get_interval.test \ sched_xetaffinity.test \ sched_xetattr.test \ sched_xetparam.test \ diff --git a/tests/sched_rr_get_interval.c b/tests/sched_rr_get_interval.c new file mode 100644 index 00000000..dd069e27 --- /dev/null +++ b/tests/sched_rr_get_interval.c @@ -0,0 +1,26 @@ +#include "tests.h" +#include + +#ifdef __NR_sched_rr_get_interval + +# include +# include +# include + +int +main(void) +{ + struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + long rc = syscall(__NR_sched_rr_get_interval, -1, tp); + printf("sched_rr_get_interval(-1, %p) = %ld %s (%m)\n", + tp, rc, errno2name()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval") + +#endif diff --git a/tests/sched_rr_get_interval.test b/tests/sched_rr_get_interval.test new file mode 100755 index 00000000..828ba5d0 --- /dev/null +++ b/tests/sched_rr_get_interval.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sched_rr_get_interval syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -- 2.40.0