Module Name: src Committed By: apb Date: Wed Jan 4 13:45:55 UTC 2012
Modified Files: src/sys/compat/common: kern_time_50.c src/sys/compat/sys: clockctl.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/compat/common/kern_time_50.c cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/clockctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/common/kern_time_50.c diff -u src/sys/compat/common/kern_time_50.c:1.20 src/sys/compat/common/kern_time_50.c:1.21 --- src/sys/compat/common/kern_time_50.c:1.20 Fri Nov 18 03:34:13 2011 +++ src/sys/compat/common/kern_time_50.c Wed Jan 4 13:45:55 2012 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: kern_time_50 #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 @@ compat50_clockctlioctl(dev_t dev, u_long 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; } Index: src/sys/compat/sys/clockctl.h diff -u src/sys/compat/sys/clockctl.h:1.2 src/sys/compat/sys/clockctl.h:1.3 --- src/sys/compat/sys/clockctl.h:1.2 Sun Jan 11 02:45:50 2009 +++ src/sys/compat/sys/clockctl.h Wed Jan 4 13:45:55 2012 @@ -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 @@ struct clockctl50_clock_settime { #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 *);