diff options
author | alc <alc@FreeBSD.org> | 2001-04-01 06:37:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2001-04-01 06:37:40 +0000 |
commit | 0aa5742239dbb3f97501cb9dec90ef1c0fb72aab (patch) | |
tree | fe0d8aa46302fee2a4f685151eb44f31010dbc88 /sys | |
parent | 79a944fb6fef3c4b2a5023905ee295eb4825f1e4 (diff) | |
download | FreeBSD-src-0aa5742239dbb3f97501cb9dec90ef1c0fb72aab.zip FreeBSD-src-0aa5742239dbb3f97501cb9dec90ef1c0fb72aab.tar.gz |
Add linux_sched_get_priority_max() and linux_sched_get_priority_min(): The
policy parameter requires translation.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 56 | ||||
-rw-r--r-- | sys/i386/linux/syscalls.master | 4 |
2 files changed, 58 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 790e679..ffb280c 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1175,6 +1175,62 @@ linux_sched_getscheduler(p, uap) return error; } +int +linux_sched_get_priority_max(p, uap) + struct proc *p; + struct linux_sched_get_priority_max_args *uap; +{ + struct sched_get_priority_max_args bsd; + +#ifdef DEBUG + if (ldebug(sched_get_priority_max)) + printf(ARGS(sched_get_priority_max, "%d"), uap->policy); +#endif + + switch (uap->policy) { + case LINUX_SCHED_OTHER: + bsd.policy = SCHED_OTHER; + break; + case LINUX_SCHED_FIFO: + bsd.policy = SCHED_FIFO; + break; + case LINUX_SCHED_RR: + bsd.policy = SCHED_RR; + break; + default: + return EINVAL; + } + return sched_get_priority_max(p, &bsd); +} + +int +linux_sched_get_priority_min(p, uap) + struct proc *p; + struct linux_sched_get_priority_min_args *uap; +{ + struct sched_get_priority_min_args bsd; + +#ifdef DEBUG + if (ldebug(sched_get_priority_min)) + printf(ARGS(sched_get_priority_min, "%d"), uap->policy); +#endif + + switch (uap->policy) { + case LINUX_SCHED_OTHER: + bsd.policy = SCHED_OTHER; + break; + case LINUX_SCHED_FIFO: + bsd.policy = SCHED_FIFO; + break; + case LINUX_SCHED_RR: + bsd.policy = SCHED_RR; + break; + default: + return EINVAL; + } + return sched_get_priority_min(p, &bsd); +} + #define REBOOT_CAD_ON 0x89abcdef #define REBOOT_CAD_OFF 0 #define REBOOT_HALT 0xcdef0123 diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index c81a746..0ef794b 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -235,8 +235,8 @@ const struct sched_param *param); } 157 STD POSIX { int linux_sched_getscheduler(pid_t pid); } 158 NOPROTO POSIX { int sched_yield (void); } -159 NOPROTO POSIX { int sched_get_priority_max (int policy); } -160 NOPROTO POSIX { int sched_get_priority_min (int policy); } +159 STD POSIX { int linux_sched_get_priority_max(int policy); } +160 STD POSIX { int linux_sched_get_priority_min(int policy); } 161 NOPROTO POSIX { int sched_rr_get_interval (pid_t pid, \ struct timespec *interval); } 162 NOPROTO POSIX { int nanosleep(const struct timespec *rqtp, \ |