diff options
| author | Alan Cox <alc@FreeBSD.org> | 2001-04-01 06:37:40 +0000 |
|---|---|---|
| committer | Alan Cox <alc@FreeBSD.org> | 2001-04-01 06:37:40 +0000 |
| commit | 21c8cdfb96ccc1af74b2cdaf4e99467446346bfc (patch) | |
| tree | 918a42caa2b10159e1ee696c7d0eedbf2603532f /sys | |
| parent | 3ed49ce8da85e1be3473752b22e2f53d66aa771a (diff) | |
Notes
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 790e679ba36dd..ffb280cf9a27f 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 c81a74650a9ec..0ef794bf079b3 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, \ |
