Use copyout to access user memory.
Submittted by: pho MFC After: 2 days
This commit is contained in:
parent
0943de6b01
commit
36d0218129
@ -306,6 +306,7 @@ int sched_rr_get_interval(struct thread *td,
|
|||||||
{
|
{
|
||||||
int e;
|
int e;
|
||||||
struct thread *targettd;
|
struct thread *targettd;
|
||||||
|
struct timespec timespec;
|
||||||
struct proc *targetp;
|
struct proc *targetp;
|
||||||
|
|
||||||
mtx_lock(&Giant);
|
mtx_lock(&Giant);
|
||||||
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
|
|||||||
PROC_UNLOCK(targetp);
|
PROC_UNLOCK(targetp);
|
||||||
if (e == 0) {
|
if (e == 0) {
|
||||||
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
||||||
uap->interval);
|
×pec);
|
||||||
|
if (e == 0)
|
||||||
|
e = copyout(×pec, uap->interval,
|
||||||
|
sizeof(timespec));
|
||||||
}
|
}
|
||||||
done2:
|
done2:
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
|
@ -306,6 +306,7 @@ int sched_rr_get_interval(struct thread *td,
|
|||||||
{
|
{
|
||||||
int e;
|
int e;
|
||||||
struct thread *targettd;
|
struct thread *targettd;
|
||||||
|
struct timespec timespec;
|
||||||
struct proc *targetp;
|
struct proc *targetp;
|
||||||
|
|
||||||
mtx_lock(&Giant);
|
mtx_lock(&Giant);
|
||||||
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
|
|||||||
PROC_UNLOCK(targetp);
|
PROC_UNLOCK(targetp);
|
||||||
if (e == 0) {
|
if (e == 0) {
|
||||||
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
||||||
uap->interval);
|
×pec);
|
||||||
|
if (e == 0)
|
||||||
|
e = copyout(×pec, uap->interval,
|
||||||
|
sizeof(timespec));
|
||||||
}
|
}
|
||||||
done2:
|
done2:
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user