From 307c6bb14996af08596d7169372631784e07b77f Mon Sep 17 00:00:00 2001 From: sobomax Date: Wed, 8 Jun 2005 20:41:28 +0000 Subject: Properly convert FreeBSD priority values into Linux values in the getpriority(2) syscall. PR: kern/81951 Submitted by: Andriy Gapon --- sys/compat/linux/linux_misc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 4c6b53f..e72c528 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1401,3 +1401,16 @@ linux_nosys(struct thread *td, struct nosys_args *ignore) return (ENOSYS); } + +int +linux_getpriority(struct thread *td, struct linux_getpriority_args *args) +{ + struct getpriority_args bsd_args; + int error; + + bsd_args.which = args->which; + bsd_args.who = args->who; + error = getpriority(td, &bsd_args); + td->td_retval[0] = 20 - td->td_retval[0]; + return error; +} -- cgit v1.1