Author: kib
Date: Tue Jul 31 17:15:31 2018
New Revision: 336980
URL: https://svnweb.freebsd.org/changeset/base/336980

Log:
  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

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jul 31 17:06:31 2018        
(r336979)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jul 31 17:15:31 2018        
(r336980)
@@ -3485,3 +3485,20 @@ freebsd32_ppoll(struct thread *td, struct freebsd32_pp
 
        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);
+}

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master   Tue Jul 31 17:06:31 2018        
(r336979)
+++ head/sys/compat/freebsd32/syscalls.master   Tue Jul 31 17:15:31 2018        
(r336980)
@@ -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, \
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to