mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
getrusage(2): fix return value under 32-bit emulation
According to the man page, getrusage(2) should return EFAULT if the rusage argument lies outside of the process's address space. But due to an oversight in r100384, that's never been the case during 32-bit emulation. Fix it. PR: 230153 Reported by: tests(7) Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16500
This commit is contained in:
parent
6dfd050075
commit
5cf35a100c
1 changed files with 2 additions and 5 deletions
|
|
@ -883,12 +883,9 @@ freebsd32_getrusage(struct thread *td, struct freebsd32_getrusage_args *uap)
|
|||
int error;
|
||||
|
||||
error = kern_getrusage(td, uap->who, &s);
|
||||
if (error)
|
||||
return (error);
|
||||
if (uap->rusage != NULL) {
|
||||
freebsd32_rusage_out(&s, &s32);
|
||||
freebsd32_rusage_out(&s, &s32);
|
||||
if (error == 0)
|
||||
error = copyout(&s32, uap->rusage, sizeof(s32));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue