]> git.ipfire.org Git - thirdparty/util-linux.git/commit
hwclock: make glibc 2.31 compatible
authorJ William Piggott <elseifthen@gmx.com>
Sat, 22 Feb 2020 01:03:47 +0000 (20:03 -0500)
committerKarel Zak <kzak@redhat.com>
Wed, 15 Apr 2020 07:35:39 +0000 (09:35 +0200)
commit0967f9a3f18e0320571db8dbc347c1e38b97f286
treebd9003b061b5af7f6d97dbf3bcc7af9c84a559d3
parent61b384b36105fe682ddf16b9379f446d935603bc
hwclock: make glibc 2.31 compatible

______________________________________________________
GNU C Library NEWS -- history of user-visible changes.
Version 2.31
Deprecated and removed features, and other changes affecting compatibility:

* The settimeofday function can still be used to set a system-wide time
  zone when the operating system supports it.  This is because the Linux
  kernel reused the API, on some architectures, to describe a system-wide
  time-zone-like offset between the software clock maintained by the kernel,
  and the "RTC" clock that keeps time when the system is shut down.

  However, to reduce the odds of this offset being set by accident,
  settimeofday can no longer be used to set the time and the offset
  simultaneously.  If both of its two arguments are non-null, the call
  will fail (setting errno to EINVAL).

  Callers attempting to set this offset should also be prepared for the call
  to fail and set errno to ENOSYS; this already happens on the Hurd and on
  some Linux architectures.  The Linux kernel maintainers are discussing a
  more principled replacement for the reused API.  After a replacement
  becomes available, we will change settimeofday to fail with ENOSYS on all
  platforms when its 'tzp' argument is not a null pointer.

  settimeofday itself is obsolescent according to POSIX.  Programs that set
  the system time should use clock_settime and/or the adjtime family of
  functions instead.  We may cease to make settimeofday available to newly
  linked binaries after there is a replacement for Linux's time-zone-like
  offset API.
______________________________________________________

hwclock(8) had one settimeofday(2) call where both args were set for
--hctosys when the RTC was ticking UTC. This allowed setting the system
time, timezone, and locking the warp_clock function with a single call.
That operation now takes 3 calls of settimeofday(2).

Although this common operation now takes three calls, the overall logic
for the set_system_clock() function was simplified.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock.c