Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jul 2018 17:15:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336980 - head/sys/compat/freebsd32
Message-ID:  <201807311715.w6VHFV1C015213@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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, \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807311715.w6VHFV1C015213>