Index: include/linux/sysctl.h =================================================================== RCS file: /root/LinuxCVS/Kernel/include/linux/sysctl.h,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.7.2.2 diff -u -r1.1.1.7 -r1.1.1.7.2.2 --- include/linux/sysctl.h 18 Aug 2002 20:12:08 -0000 1.1.1.7 +++ include/linux/sysctl.h 17 Oct 2002 20:02:05 -0000 1.1.1.7.2.2 @@ -124,8 +124,20 @@ KERN_CORE_USES_PID=52, /* int: use core or core.%pid */ KERN_TAINTED=53, /* int: various kernel tainted flags */ KERN_CADPID=54, /* int: PID of the process to notify on CAD */ + KERN_TIME=55, /* directory: time */ }; +/* KERN_TIME names: */ +enum +{ + KERN_TIME_TIMEZONE=1, /* struct: timezone */ + KERN_TIME_RTC_UPDATE=2, /* int: rtc_update */ + KERN_TIME_RTC_RUNS_LOCALTIME=3, /* int: rtc_runs_localtime */ + KERN_TIME_TIME_TICK=4, /* int: time_tick */ + KERN_TIME_TICKADJ=5, /* int: tickadj */ + KERN_TIME_HZ=6, /* int: HZ */ + KERN_TIME_PPS_VAR=99, /* struct pps_var: pps */ +}; /* CTL_VM names: */ enum # the following patch was edited! Index: kernel/time.c =================================================================== RCS file: /root/LinuxCVS/Kernel/kernel/time.c,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.4.2.3 diff -u -r1.1.1.4 -r1.1.1.4.2.3 --- kernel/time.c 18 Aug 2002 20:12:14 -0000 1.1.1.4 +++ kernel/time.c 17 Oct 2002 20:06:20 -0000 1.1.1.4.2.3 @@ -7,28 +7,185 @@ +/* Define entries for `time' subdirectory. */ +static /* const */ int sysctl_tz_min = -12 * 60; +static /* const */ int sysctl_tz_max = 12 * 60; +static /* const */ int sysctl_zero = 0; +static /* const */ int sysctl_one = 1; +static /* const */ int sysctl_no_max = 1 << 30; +static /* const */ int sysctl_tick_min = 9 * (NANOSECOND/10/hz); +static /* const */ int sysctl_tick_max = 11 * (NANOSECOND/10/hz); +static /* const */ int sysctl_tickadj_max = (NANOSECOND/hz) / 4; +static /* const */ int sysctl_hz = HZ; + +ctl_table kern_time_table[] = { + /* Warning: ``sys_tz.tz_dsttime'' isn't checked properly */ + {KERN_TIME_TIMEZONE, "timezone", &sys_tz, sizeof(sys_tz), + 0644, NULL, &proc_dointvec_minmax, NULL, NULL, + &sysctl_tz_min, &sysctl_tz_max}, + {KERN_TIME_RTC_RUNS_LOCALTIME, "rtc_runs_localtime", + &rtc_runs_localtime, sizeof(rtc_runs_localtime), + 0644, NULL, &proc_dointvec_minmax, NULL, NULL, + &sysctl_zero, &sysctl_one}, + {KERN_TIME_RTC_UPDATE, "rtc_update", &rtc_update, sizeof(rtc_update), + 0644, NULL, &proc_dointvec_minmax, NULL, NULL, + &sysctl_zero, &sysctl_no_max}, + {KERN_TIME_TIME_TICK, "time_tick", &time_tick, sizeof(time_tick), + 0644, NULL, &proc_dointvec_minmax, NULL, NULL, + &sysctl_tick_min, &sysctl_tick_max}, + {KERN_TIME_TICKADJ, "tickadj", &tickadj, sizeof(tickadj), + 0644, NULL, &proc_dointvec_minmax, NULL, NULL, + &sysctl_one, &sysctl_tickadj_max}, + {KERN_TIME_HZ, "Hz", &sysctl_hz, sizeof(sysctl_hz), + 0444, NULL, &proc_dointvec}, +#ifdef CONFIG_NTP +#ifdef CONFIG_NTP_PPS + /* this entry is for debugging (experimental) */ + {KERN_TIME_PPS_VAR, "pps", &pps, sizeof(pps), + 0444, NULL, &proc_dointvec}, +#endif +#endif + {0} +}; + Index: Documentation/sysctl/kernel.txt =================================================================== RCS file: /root/LinuxCVS/Kernel/Documentation/sysctl/kernel.txt,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.6.2 diff -u -r1.1.1.2 -r1.1.1.2.6.2 --- Documentation/sysctl/kernel.txt 13 Dec 2001 18:48:49 -0000 1.1.1.2 +++ Documentation/sysctl/kernel.txt 17 Oct 2002 20:14:21 -0000 1.1.1.2.6.2 @@ -40,6 +40,7 @@ - sg-big-buff [ generic SCSI device (sg) ] - shmmax [ sysv ipc ] - tainted +- time [ directory ] - version - zero-paged [ PPC only ] @@ -218,6 +219,37 @@ on the maximum shared memory segment size that can be created. Shared memory segments up to 1Gb are now supported in the kernel. This value defaults to SHMMAX. + +============================================================== + +time: + +time/Hz (r/o): + Intended to reveal the value of HZ to user programs. + +time/pps (r/o): + (experimental) Used to reveal the internals of ``struct pps'' + +time/rtc_runs_localtime (r/w): + Set to ``1'' if RTC is set to local time + +time/rtc_update (r/w): + Amount of seconds after which the RTC is updated from system time + if ``STA_UNSYNC'' in ``time_status'' is cleared. When setting the + system time directly, it will be updated the next second. + Setting ``rtc_update'' to a value <= 0, the RTC is not updated. + +time/tickadj (r/w): + Amount of nanoseconds that will be used to adjust a wrong clock + gradually (using ``adjtime()''). + +time/time_tick (r/w): + Amount of nanoseconds to add every timer interrupt. + +time/timezone (r/w): + Two values describing the time zone offset west of GMT in minutes, + and whether daylight saving time is active (required to convert + kernel time to local time). ============================================================== Index: kernel/sysctl.c =================================================================== RCS file: /root/LinuxCVS/Kernel/kernel/sysctl.c,v retrieving revision 1.1.1.11 retrieving revision 1.1.1.11.2.1 diff -u -r1.1.1.11 -r1.1.1.11.2.1 --- kernel/sysctl.c 18 Aug 2002 20:12:14 -0000 1.1.1.11 +++ kernel/sysctl.c 19 Aug 2002 20:36:01 -0000 1.1.1.11.2.1 @@ -14,6 +14,7 @@ * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer. * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill * Wendling. + * Added `time' subdirectory, 11/09/99, Ulrich Windl * The list_for_each() macro wasn't appropriate for the sysctl loop. * Removed it and replaced it with older style, 03/23/00, Bill Wendling */ @@ -108,6 +109,7 @@ { root_table, LIST_HEAD_INIT(root_table_header.ctl_entry) }; static ctl_table kern_table[]; +extern ctl_table kern_time_table[]; static ctl_table vm_table[]; #ifdef CONFIG_NET extern ctl_table net_table[]; @@ -256,6 +258,7 @@ {KERN_S390_USER_DEBUG_LOGGING,"userprocess_debug", &sysctl_userprocess_debug,sizeof(int),0644,NULL,&proc_dointvec}, #endif + {KERN_TIME, "time", NULL, 0, 0555, kern_time_table}, {0} };