Provide compat32 shims for sched_rr_get_interval(2).

The interface uses struct timespec, which needs a translation.

Reported and reviewed by:	asomers
PR:	230175
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D16525
This commit is contained in:
Konstantin Belousov 2018-07-31 17:15:31 +00:00
parent 5836319ae6
commit 3de1e9aa1e
2 changed files with 20 additions and 2 deletions

View File

@ -3485,3 +3485,20 @@ freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap)
return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp));
}
int
freebsd32_sched_rr_get_interval(struct thread *td,
struct freebsd32_sched_rr_get_interval_args *uap)
{
struct timespec ts;
struct timespec32 ts32;
int error;
error = kern_sched_rr_get_interval(td, uap->pid, &ts);
if (error == 0) {
CP(ts, ts32, tv_sec);
CP(ts, ts32, tv_nsec);
error = copyout(&ts32, uap->interval, sizeof(ts32));
}
return (error);
}

View File

@ -591,8 +591,9 @@
331 AUE_NULL NOPROTO { int sched_yield (void); }
332 AUE_NULL NOPROTO { int sched_get_priority_max (int policy); }
333 AUE_NULL NOPROTO { int sched_get_priority_min (int policy); }
334 AUE_NULL NOPROTO { int sched_rr_get_interval (pid_t pid, \
struct timespec *interval); }
334 AUE_NULL STD { int freebsd32_sched_rr_get_interval ( \
pid_t pid, \
struct timespec32 *interval); }
335 AUE_NULL NOPROTO { int utrace(const void *addr, size_t len); }
336 AUE_SENDFILE COMPAT4 { int freebsd32_sendfile(int fd, int s, \
uint32_t offset1, uint32_t offset2, \