Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

timekeeping: Provide adjtimex() for auxiliary clocks

The behaviour is close to clock_adtime(CLOCK_REALTIME) with the
following differences:

1) ADJ_SETOFFSET adjusts the auxiliary clock offset

2) ADJ_TAI is not supported

3) Leap seconds are not supported

4) PPS is not supported

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250625183758.317946543@linutronix.de

+16
+16
kernel/time/timekeeping.c
··· 2875 2875 return 0; 2876 2876 } 2877 2877 2878 + static int aux_clock_adj(const clockid_t id, struct __kernel_timex *txc) 2879 + { 2880 + struct tk_data *aux_tkd = aux_get_tk_data(id); 2881 + struct adjtimex_result result = { }; 2882 + 2883 + if (!aux_tkd) 2884 + return -ENODEV; 2885 + 2886 + /* 2887 + * @result is ignored for now as there are neither hrtimers nor a 2888 + * RTC related to auxiliary clocks for now. 2889 + */ 2890 + return __do_adjtimex(aux_tkd, txc, &result); 2891 + } 2892 + 2878 2893 const struct k_clock clock_aux = { 2879 2894 .clock_getres = aux_get_res, 2880 2895 .clock_get_timespec = aux_get_timespec, 2881 2896 .clock_set = aux_clock_set, 2897 + .clock_adj = aux_clock_adj, 2882 2898 }; 2883 2899 2884 2900 static __init void tk_aux_setup(void)