struct timex and Linux adjtimex()
Konstantin Belousov
kostikbel at gmail.com
Thu Dec 3 22:41:15 UTC 2020
On Thu, Dec 03, 2020 at 10:13:34PM +0000, Poul-Henning Kamp wrote:
> --------
> Cy Schubert writes:
>
> > I will go back
> > with my initial proposal of a timespec add/subtract syscall takes a
> > timespec as input increments or decrements the clock by the timespec and
> > returns a timespec with the time.
>
> I would be tempted by the clock_settime(2) "clock_id" argument.
>
> The functionality required has a LOT more commonality with
> clock_settime(2) than with ntp_adjtime(2), and absconding with a
> couple of the top bits of clock_id for "CLOCK_ADD_ADJUSTMENT" and
> "CLOCK_SUB_ADJUSTMENT" would be be a pretty clean solution.
The adjustments are only applicable to CLOCK_REALTIME, am I wrong ?
If only CLOCK_REALTIME is affected (or even if things like CLOCK_MONOTONIC
get parallel adjustment), it makes more sense to allocate designated clock
ids like CLOCK_BSD_ADD_ADJ instead of carving bits in id numbers.
I mean, we do not need/want to adjust CLOCK_VIRTUAL, CLOCK_PROF and other
non-wall clock related clocks.
More information about the freebsd-arch
mailing list