mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
Kernel: Use Userspace<T> in sched_getparam syscall
This commit is contained in:
parent
f011c420c1
commit
9db5a1b92f
2 changed files with 5 additions and 5 deletions
|
@ -295,7 +295,7 @@ public:
|
||||||
int sys$getsockname(const Syscall::SC_getsockname_params*);
|
int sys$getsockname(const Syscall::SC_getsockname_params*);
|
||||||
int sys$getpeername(const Syscall::SC_getpeername_params*);
|
int sys$getpeername(const Syscall::SC_getpeername_params*);
|
||||||
int sys$sched_setparam(pid_t pid, Userspace<const struct sched_param*>);
|
int sys$sched_setparam(pid_t pid, Userspace<const struct sched_param*>);
|
||||||
int sys$sched_getparam(pid_t pid, struct sched_param* param);
|
int sys$sched_getparam(pid_t pid, Userspace<struct sched_param*>);
|
||||||
int sys$create_thread(void* (*)(void*), const Syscall::SC_create_thread_params*);
|
int sys$create_thread(void* (*)(void*), const Syscall::SC_create_thread_params*);
|
||||||
void sys$exit_thread(void*);
|
void sys$exit_thread(void*);
|
||||||
int sys$join_thread(int tid, void** exit_value);
|
int sys$join_thread(int tid, void** exit_value);
|
||||||
|
|
|
@ -76,10 +76,10 @@ int Process::sys$sched_setparam(int tid, Userspace<const struct sched_param*> us
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Process::sys$sched_getparam(pid_t pid, struct sched_param* param)
|
int Process::sys$sched_getparam(pid_t pid, Userspace<struct sched_param*> user_param)
|
||||||
{
|
{
|
||||||
REQUIRE_PROMISE(proc);
|
REQUIRE_PROMISE(proc);
|
||||||
if (!validate_write_typed(param))
|
if (!validate_write_typed(user_param))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
|
@ -93,8 +93,8 @@ int Process::sys$sched_getparam(pid_t pid, struct sched_param* param)
|
||||||
if (!is_superuser() && m_euid != peer->process().m_uid && m_uid != peer->process().m_uid)
|
if (!is_superuser() && m_euid != peer->process().m_uid && m_uid != peer->process().m_uid)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
int priority = peer->priority();
|
struct sched_param param { (int) peer->priority() };
|
||||||
copy_to_user(¶m->sched_priority, &priority);
|
copy_to_user(user_param, ¶m);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue