Use copyout to access user memory.

Submittted by: pho
MFC After: 2 days
This commit is contained in:
Alfred Perlstein 2003-01-07 20:10:04 +00:00
parent 1f17965656
commit a11acc6f8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108896
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;
struct thread *targettd;
struct timespec timespec;
struct proc *targetp;
mtx_lock(&Giant);
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
PROC_UNLOCK(targetp);
if (e == 0) {
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:
mtx_unlock(&Giant);

View File

@ -306,6 +306,7 @@ int sched_rr_get_interval(struct thread *td,
{
int e;
struct thread *targettd;
struct timespec timespec;
struct proc *targetp;
mtx_lock(&Giant);
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
PROC_UNLOCK(targetp);
if (e == 0) {
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:
mtx_unlock(&Giant);