Index: kern/kern_sysctl.c =================================================================== RCS file: /cvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.136 diff -u -r1.136 kern_sysctl.c --- kern/kern_sysctl.c 28 Nov 2005 00:14:29 -0000 1.136 +++ kern/kern_sysctl.c 10 Feb 2006 14:43:45 -0000 @@ -241,6 +241,8 @@ int securelevel; #endif +int boottime_adj; + /* * kernel related system variables. */ @@ -344,8 +346,17 @@ case KERN_CLOCKRATE: return (sysctl_clockrate(oldp, oldlenp)); case KERN_BOOTTIME: - return (sysctl_rdstruct(oldp, oldlenp, newp, &boottime, - sizeof(struct timeval))); + { + struct timeval tv; + + tv = boottime; + tv.tv_sec += boottime_adj; + + return (sysctl_rdstruct(oldp, oldlenp, newp, &tv, + sizeof(struct timeval))); + } + case KERN_BOOTTIMEADJ: + return (sysctl_int(oldp, oldlenp, newp, newlen, &boottime_adj)); case KERN_VNODE: return (sysctl_vnode(oldp, oldlenp, p)); #ifndef SMALL_KERNEL Index: sys/sysctl.h =================================================================== RCS file: /cvs/src/sys/sys/sysctl.h,v retrieving revision 1.85 diff -u -r1.85 sysctl.h --- sys/sysctl.h 13 Dec 2005 00:35:23 -0000 1.85 +++ sys/sysctl.h 10 Feb 2006 14:43:46 -0000 @@ -184,7 +184,8 @@ #define KERN_TIMECOUNTER 69 /* node: timecounter */ #define KERN_MAXLOCKSPERUID 70 /* int: locks per uid */ #define KERN_CPTIME2 71 /* array: cp_time2 */ -#define KERN_MAXID 72 /* number of valid kern ids */ +#define KERN_BOOTTIMEADJ 72 /* int: boottime adjustment. */ +#define KERN_MAXID 73 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -259,6 +260,7 @@ { "timecounter", CTLTYPE_NODE }, \ { "maxlocksperuid", CTLTYPE_INT }, \ { "cp_time2", CTLTYPE_STRUCT }, \ + { "boottime_adj", CTLTYPE_INT }, \ } /*