Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat Provide a COMPAT_50 version of the CLOCKCTL_NTP_A...



details:   https://anonhg.NetBSD.org/src/rev/4f6b8da4fe43
branches:  trunk
changeset: 772445:4f6b8da4fe43
user:      apb <apb%NetBSD.org@localhost>
date:      Wed Jan 04 13:45:55 2012 +0000

description:
Provide a COMPAT_50 version of the CLOCKCTL_NTP_ADJTIME ioctl.
When time_t was changed from 32 to 64 bits, this ioctl's number
was changed from _IOWR('C', 0x4, struct clockctl_ntp_adjtime)
to _IOWR('C', 0x8, struct clockctl_ntp_adjtime), but the data
structure did not change, so all the compat code has to do is
change the number and try again.

diffstat:

 sys/compat/common/kern_time_50.c |  10 ++++++++--
 sys/compat/sys/clockctl.h        |   9 ++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diffs (61 lines):

diff -r db3f3aa29d8d -r 4f6b8da4fe43 sys/compat/common/kern_time_50.c
--- a/sys/compat/common/kern_time_50.c  Wed Jan 04 13:40:53 2012 +0000
+++ b/sys/compat/common/kern_time_50.c  Wed Jan 04 13:45:55 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time_50.c,v 1.20 2011/11/18 03:34:13 christos Exp $       */
+/*     $NetBSD: kern_time_50.c,v 1.21 2012/01/04 13:45:55 apb Exp $    */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.20 2011/11/18 03:34:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.21 2012/01/04 13:45:55 apb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -53,6 +53,7 @@
 #include <sys/kauth.h>
 #include <sys/time.h>
 #include <sys/timex.h>
+#include <sys/clockctl.h>
 #include <sys/aio.h>
 #include <sys/poll.h>
 #include <sys/syscallargs.h>
@@ -669,6 +670,11 @@
                error = clock_settime1(l->l_proc, args->clock_id, &tp, true);
                break;
        }
+       case CLOCKCTL_ONTP_ADJTIME:
+               /* The ioctl number changed but the data did not change. */
+               error = clockctlioctl(dev, CLOCKCTL_NTP_ADJTIME,
+                   data, flags, l);
+               break;
        default:
                error = EINVAL;
        }
diff -r db3f3aa29d8d -r 4f6b8da4fe43 sys/compat/sys/clockctl.h
--- a/sys/compat/sys/clockctl.h Wed Jan 04 13:40:53 2012 +0000
+++ b/sys/compat/sys/clockctl.h Wed Jan 04 13:45:55 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: clockctl.h,v 1.2 2009/01/11 02:45:50 christos Exp $ */
+/*      $NetBSD: clockctl.h,v 1.3 2012/01/04 13:45:55 apb Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -59,6 +59,13 @@
 
 #define CLOCKCTL_OCLOCK_SETTIME _IOW('C', 0x3, struct clockctl50_clock_settime)
 
+struct clockctl50_ntp_adjtime {
+       struct timex *tp;
+       register_t retval;
+};
+
+#define CLOCKCTL_ONTP_ADJTIME _IOWR('C', 0x4, struct clockctl50_ntp_adjtime)
+
 #ifdef _KERNEL
 struct lwp;
 int compat50_clockctlioctl(dev_t, u_long, void *, int, struct lwp *);



Home | Main Index | Thread Index | Old Index