Dmitry V. Levin
18b582ec11
* tests/init_delete_module.h (bogus_zero): Remove. * tests/delete_module.c (main): Replace bogus_zero and (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. * tests/finit_module.c (main): Replace bogus_zero with F8ILL_KULONG_MASK. * tests/init_module.c (main): Likewise. * tests/pipe2.c (main): Likewise. * tests/epoll_ctl.c (invoke_syscall): Replace (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise. * tests/fanotify_init.c (main): Likewise. * tests/xetpgid.c (main): Likewise. * tests/xetpriority.c (main): Likewise. (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. * tests/fanotify_mark.c (main): Likewise. * tests/file_handle.c (main): Likewise. * tests/kexec_load.c (main): Likewise. * tests/setfsugid.c (main): Likewise. * tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. * tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
31 lines
647 B
C
31 lines
647 B
C
#include "tests.h"
|
|
#include <asm/unistd.h>
|
|
|
|
#if defined __NR_getpriority && defined __NR_setpriority
|
|
|
|
# include <stdio.h>
|
|
# include <sys/resource.h>
|
|
# include <unistd.h>
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
const int pid = getpid();
|
|
long rc = syscall(__NR_getpriority, PRIO_PROCESS,
|
|
F8ILL_KULONG_MASK | pid);
|
|
printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc);
|
|
|
|
rc = syscall(__NR_setpriority, PRIO_PROCESS,
|
|
F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK);
|
|
printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc));
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
|
|
SKIP_MAIN_UNDEFINED("__NR_getpriority && _NR_setpriority")
|
|
|
|
#endif
|