tests: add sched_get_priority_mxx.test
* tests/sched_get_priority_mxx.c: New file. * tests/sched_get_priority_mxx.test: New test. * tests/.gitignore: Add sched_get_priority_mxx. * tests/Makefile.am (check_PROGRAMS): Likewise. (TESTS): Add sched_get_priority_mxx.test.
This commit is contained in:
parent
ab917ae5af
commit
1eed594f30
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -95,6 +95,7 @@ rt_sigqueueinfo
|
||||
rt_sigsuspend
|
||||
rt_sigtimedwait
|
||||
rt_tgsigqueueinfo
|
||||
sched_get_priority_mxx
|
||||
sched_xetaffinity
|
||||
sched_xetattr
|
||||
scm_rights
|
||||
|
@ -143,6 +143,7 @@ check_PROGRAMS = \
|
||||
rt_sigsuspend \
|
||||
rt_sigtimedwait \
|
||||
rt_tgsigqueueinfo \
|
||||
sched_get_priority_mxx \
|
||||
sched_xetaffinity \
|
||||
sched_xetattr \
|
||||
scm_rights \
|
||||
@ -308,6 +309,7 @@ TESTS = \
|
||||
rt_sigsuspend.test \
|
||||
rt_sigtimedwait.test \
|
||||
rt_tgsigqueueinfo.test \
|
||||
sched_get_priority_mxx.test \
|
||||
sched_xetaffinity.test \
|
||||
sched_xetattr.test \
|
||||
scm_rights-fd.test \
|
||||
|
29
tests/sched_get_priority_mxx.c
Normal file
29
tests/sched_get_priority_mxx.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "tests.h"
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#if defined(__NR_sched_get_priority_min) \
|
||||
&& defined(__NR_sched_get_priority_max)
|
||||
|
||||
# include <sched.h>
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int rc = syscall(__NR_sched_get_priority_min, SCHED_FIFO);
|
||||
printf("sched_get_priority_min(SCHED_FIFO) = %d\n", rc);
|
||||
|
||||
rc = syscall(__NR_sched_get_priority_max, SCHED_RR);
|
||||
printf("sched_get_priority_max(SCHED_RR) = %d\n", rc);
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min"
|
||||
" && defined __NR_sched_get_priority_max");
|
||||
|
||||
#endif
|
11
tests/sched_get_priority_mxx.test
Executable file
11
tests/sched_get_priority_mxx.test
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check sched_get_priority_min and sched_get_priority_max syscalls decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
run_prog > /dev/null
|
||||
OUT="$LOG.out"
|
||||
run_strace -esched_get_priority_min,sched_get_priority_max -a33 $args > "$OUT"
|
||||
match_diff "$LOG" "$OUT"
|
||||
rm -f "$OUT"
|
Loading…
Reference in New Issue
Block a user