Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 7 Apr 2024 19:37:03 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Cc: busybox@...ybox.net, Waldemar Brodkorb <wbx@...nadk.org>
Subject: Re: Busybox hwclock failing to build with musl RISC-V 32-bit:
 SYS_settimeofday undefined

Hi,

this is a very much a Busybox problem. musl does provide settimeofday(),
but it doesn't send the time zone to the kernel. This is because the
kernel time zone has some hardcoded unexpected uses, to be nice about
it.

The Busybox maintainers don't like that musl doesn't do this, and so
call the syscall directly. And this fails for RISC-V, which doesn't have
a SYS_settimeofday. I mean, it also fails for all the 32-bit
architectures which do have a SYS_settimeofday but with a different
timeval structure. But maybe the timezone structure is correct there.

Busybox is trying to do the wrong thing here, simple as. The reasoning
for not doing the right thing I have read is spurious at best. If the
hwclock time is in local time, then /etc/localtime should be the correct
time zone, and mktime() will provide the closest you are going to get to
a "right" system time.

Note that we recently had a thread about the perils of local time, and
it is simply a mess, and sometimes libc has no good choices.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.