Index: sys/compat/freebsd32/freebsd32_misc.c =================================================================== --- sys/compat/freebsd32/freebsd32_misc.c +++ sys/compat/freebsd32/freebsd32_misc.c @@ -3485,3 +3485,20 @@ 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); +} Index: sys/compat/freebsd32/syscalls.master =================================================================== --- sys/compat/freebsd32/syscalls.master +++ sys/compat/freebsd32/syscalls.master @@ -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, \ Index: sys/vm/vm_mmap.c =================================================================== --- sys/vm/vm_mmap.c +++ sys/vm/vm_mmap.c @@ -591,6 +591,7 @@ int kern_mprotect(struct thread *td, uintptr_t addr0, size_t size, int prot) { + vm_map_t map; vm_offset_t addr; vm_size_t pageoff; @@ -600,11 +601,11 @@ addr -= pageoff; size += pageoff; size = (vm_size_t) round_page(size); - if (addr + size < addr) + map = &td->td_proc->p_vmspace->vm_map; + if ((addr + size) % vm_map_max(map) < addr) return (EINVAL); - switch (vm_map_protect(&td->td_proc->p_vmspace->vm_map, addr, - addr + size, prot, FALSE)) { + switch (vm_map_protect(map, addr, addr + size, prot, FALSE)) { case KERN_SUCCESS: return (0); case KERN_PROTECTION_FAILURE: