On Tue, Mar 08, 2016 at 02:23:22PM +0800, Fei Jie wrote:
> * tests/sched_xetscheduler.c: New file.
> * tests/sched_xetscheduler.test: New test.
> * tests/.gitignore: Add sched_xetscheduler.
> * tests/Makefile.am (check_PROGRAMS): Likewise.
> (TESTS): Add sched_xetscheduler.test.
> ---
>  tests/.gitignore              |  1 +
>  tests/Makefile.am             |  2 ++
>  tests/sched_xetscheduler.c    | 37 +++++++++++++++++++++++++++++++++++++
>  tests/sched_xetscheduler.test | 11 +++++++++++
>  4 files changed, 51 insertions(+)
>  create mode 100644 tests/sched_xetscheduler.c
>  create mode 100755 tests/sched_xetscheduler.test
> 
> diff --git a/tests/.gitignore b/tests/.gitignore
> index dd8d6f9..3935d53 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -94,6 +94,7 @@ sched_get_priority_mxx
>  sched_xetaffinity
>  sched_xetattr
>  sched_xetparam
> +sched_xetscheduler
>  scm_rights
>  seccomp
>  select
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 3939c1d..fcd7363 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -142,6 +142,7 @@ check_PROGRAMS = \
>       sched_xetaffinity \
>       sched_xetattr \
>       sched_xetparam \
> +     sched_xetscheduler \
>       scm_rights \
>       seccomp \
>       select \
> @@ -305,6 +306,7 @@ TESTS = \
>       sched_xetaffinity.test \
>       sched_xetattr.test \
>       sched_xetparam.test \
> +     sched_xetscheduler.test \
>       scm_rights-fd.test \
>       seccomp.test \
>       select.test \
> diff --git a/tests/sched_xetscheduler.c b/tests/sched_xetscheduler.c
> new file mode 100644
> index 0000000..abaacd6
> --- /dev/null
> +++ b/tests/sched_xetscheduler.c
> @@ -0,0 +1,37 @@
> +#include "tests.h"
> +#include <sys/syscall.h>
> +
> +#if defined __NR_sched_getscheduler && defined __NR_sched_setscheduler
> +
> +# include <sched.h>
> +# include <stdio.h>
> +# include <unistd.h>
> +
> +int
> +main(void)
> +{
> +     struct sched_param *const param = tail_alloc(sizeof(struct 
> sched_param));
> +     param->sched_priority = 99;
> +     int rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param);
> +     if (rc == -1)
> +             perror_msg_and_fail("sched_setscheduler");

Why fail the test in this case?

> +
> +     printf("sched_setscheduler(0, SCHED_FIFO, [%d]) = %d\n",
> +            param->sched_priority, rc);
> +
> +     rc = syscall(__NR_sched_getscheduler, 0);
> +     if (rc == 1) {

Please don't hardcode SCHED_FIFO.


-- 
ldv

Attachment: pgp2LdjAgpVzT.pgp
Description: PGP signature

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to