diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 790e679ba36d..ffb280cf9a27 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 c81a74650a9e..0ef794bf079b 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, \