@@ -80,6 +80,7 @@ SYSCALL_DEF(getpid);
#ifdef TARGET_NR_getppid
SYSCALL_DEF(getppid);
#endif
+SYSCALL_DEF(getpriority, ARG_DEC, ARG_DEC);
#ifdef TARGET_NR_getrlimit
SYSCALL_DEF(getrlimit, ARG_DEC, ARG_PTR);
#endif
@@ -238,6 +239,7 @@ SYSCALL_DEF(semget, ARG_DEC, ARG_DEC, ARG_HEX);
#endif
SYSCALL_DEF(sethostname, ARG_STR);
SYSCALL_DEF(setpgid, ARG_DEC, ARG_DEC);
+SYSCALL_DEF(setpriority, ARG_DEC, ARG_DEC, ARG_DEC);
#ifdef TARGET_NR_setrlimit
SYSCALL_DEF(setrlimit, ARG_DEC, ARG_PTR);
#endif
@@ -479,6 +479,29 @@ SYSCALL_IMPL(getppid)
}
#endif
+SYSCALL_IMPL(getpriority)
+{
+ abi_long ret;
+
+ /*
+ * Note that negative values are valid for getpriority, so we must
+ * differentiate based on errno settings.
+ */
+ errno = 0;
+ ret = getpriority(arg1, arg2);
+ if (ret == -1 && errno != 0) {
+ return -host_to_target_errno(errno);
+ }
+#ifdef TARGET_ALPHA
+ /* Return value is the unbiased priority. Signal no error. */
+ ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0;
+#else
+ /* Return value is a biased priority to avoid negative numbers. */
+ ret = 20 - ret;
+#endif
+ return ret;
+}
+
#ifdef TARGET_NR_getrlimit
SYSCALL_IMPL(getrlimit)
{
@@ -568,6 +591,11 @@ SYSCALL_IMPL(setpgid)
return get_errno(setpgid(arg1, arg2));
}
+SYSCALL_IMPL(setpriority)
+{
+ return get_errno(setpriority(arg1, arg2, arg3));
+}
+
#ifdef TARGET_NR_setrlimit
SYSCALL_IMPL(setrlimit)
{
@@ -4144,24 +4144,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
- case TARGET_NR_getpriority:
- /* Note that negative values are valid for getpriority, so we must
- differentiate based on errno settings. */
- errno = 0;
- ret = getpriority(arg1, arg2);
- if (ret == -1 && errno != 0) {
- return -host_to_target_errno(errno);
- }
-#ifdef TARGET_ALPHA
- /* Return value is the unbiased priority. Signal no error. */
- ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0;
-#else
- /* Return value is a biased priority to avoid negative numbers. */
- ret = 20 - ret;
-#endif
- return ret;
- case TARGET_NR_setpriority:
- return get_errno(setpriority(arg1, arg2, arg3));
#ifdef TARGET_NR_statfs
case TARGET_NR_statfs:
if (!(p = lock_user_string(arg1))) {
@@ -256,9 +256,6 @@
#ifdef TARGET_NR_getpmsg
{ TARGET_NR_getpmsg, "getpmsg" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_getpriority
-{ TARGET_NR_getpriority, "getpriority", "%s(%#x,%#x)", NULL, NULL },
-#endif
#ifdef TARGET_NR_getrandom
{ TARGET_NR_getrandom, "getrandom", NULL, NULL, NULL },
#endif
@@ -1007,9 +1004,6 @@
#ifdef TARGET_NR_setpgrp
{ TARGET_NR_setpgrp, "setpgrp" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_setpriority
-{ TARGET_NR_setpriority, "setpriority" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_setregid
{ TARGET_NR_setregid, "setregid" , NULL, NULL, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 2 ++ linux-user/syscall-proc.inc.c | 28 ++++++++++++++++++++++++++++ linux-user/syscall.c | 18 ------------------ linux-user/strace.list | 6 ------ 4 files changed, 30 insertions(+), 24 deletions(-) -- 2.17.1