Use copyout to access user memory.

Submittted by: pho
MFC After: 2 days
This commit is contained in:
alfred 2003-01-07 20:10:04 +00:00
parent 0943de6b01
commit 36d0218129
2 changed files with 10 additions and 2 deletions

View File

@ -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); &timespec);
if (e == 0)
e = copyout(&timespec, uap->interval,
sizeof(timespec));
} }
done2: done2:
mtx_unlock(&Giant); mtx_unlock(&Giant);

View File

@ -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); &timespec);
if (e == 0)
e = copyout(&timespec, uap->interval,
sizeof(timespec));
} }
done2: done2:
mtx_unlock(&Giant); mtx_unlock(&Giant);