Rik, thanks for reporting this bug. You're right, it's a regression in hwclock between glibc 2.30/2.31. It's fixed in util-linux upstream; preparing a debdiff for Focal.
...
$ lsb_release -cs focal
Older glibc: ---
$ dpkg -s util-linux libc6 | grep ^Version: Version: 2.34-0.1ubuntu8 Version: 2.30-0ubuntu3
$ sudo hwclock -s $ echo $? 0
Newer glibc: ---
$ sudo apt install libc6 . The following packages will be upgraded: libc-bin libc-dev-bin libc6 libc6-dev locales .
$ dpkg -s util-linux libc6 | grep ^Version: Version: 2.34-0.1ubuntu8 Version: 2.31-0ubuntu6
$ sudo hwclock -s hwclock: settimeofday() failed: Invalid argument $ echo $? 1
Upstream: ---
This is fixed with this upstream commit. Preparing a debdiff for Focal.
ubuntu@focal:~/util-linux$ sudo ./hwclock -s $ echo $? 0
commit cd781c405be82540484da3bfe3d3f17a39b8eb5c Author: J William Piggott <email address hidden> Date: Fri Feb 21 20:03:47 2020 -0500
hwclock: make glibc 2.31 compatible
Rik, thanks for reporting this bug.
You're right, it's a regression in hwclock between glibc 2.30/2.31.
It's fixed in util-linux upstream; preparing a debdiff for Focal.
...
$ lsb_release -cs
focal
Older glibc:
---
$ dpkg -s util-linux libc6 | grep ^Version:
Version: 2.34-0.1ubuntu8
Version: 2.30-0ubuntu3
$ sudo hwclock -s
$ echo $?
0
Newer glibc:
---
$ sudo apt install libc6
.
The following packages will be upgraded:
libc-bin libc-dev-bin libc6 libc6-dev locales
.
$ dpkg -s util-linux libc6 | grep ^Version:
Version: 2.34-0.1ubuntu8
Version: 2.31-0ubuntu6
$ sudo hwclock -s
hwclock: settimeofday() failed: Invalid argument
$ echo $?
1
Upstream:
---
This is fixed with this upstream commit.
Preparing a debdiff for Focal.
ubuntu@ focal:~ /util-linux$ sudo ./hwclock -s
$ echo $?
0
commit cd781c405be8254 0484da3bfe3d3f1 7a39b8eb5c
Author: J William Piggott <email address hidden>
Date: Fri Feb 21 20:03:47 2020 -0500
hwclock: make glibc 2.31 compatible