Add linux_sched_get_priority_max() and linux_sched_get_priority_min(): The

policy parameter requires translation.
This commit is contained in:
alc 2001-04-01 06:37:40 +00:00
parent 79a944fb6f
commit 0aa5742239
2 changed files with 58 additions and 2 deletions

View File

@ -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

View File

@ -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, \