summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-06-08 20:41:28 +0000
committersobomax <sobomax@FreeBSD.org>2005-06-08 20:41:28 +0000
commit307c6bb14996af08596d7169372631784e07b77f (patch)
tree8dad9b08a756fd0f8cc587336248415af2cfedc2 /sys/compat
parentb53b83993cd241c7f77e329490bea901c692a0d0 (diff)
downloadFreeBSD-src-307c6bb14996af08596d7169372631784e07b77f.zip
FreeBSD-src-307c6bb14996af08596d7169372631784e07b77f.tar.gz
Properly convert FreeBSD priority values into Linux values in the
getpriority(2) syscall. PR: kern/81951 Submitted by: Andriy Gapon <avg@icyb.net.ua>
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_misc.c13
1 files changed, 13 insertions, 0 deletions
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;
+}
OpenPOWER on IntegriCloud