mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: busybox@busybox.net, Waldemar Brodkorb <wbx@openadk.org>
Subject: Re: [musl] Busybox hwclock failing to build with musl RISC-V 32-bit: SYS_settimeofday undefined
Date: Sun, 7 Apr 2024 19:37:03 +0200	[thread overview]
Message-ID: <ZhLZv7xh5XnQpZxA@voyager> (raw)
In-Reply-To: <20240407191848.5c811765@windsurf>

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

  reply	other threads:[~2024-04-07 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07 17:18 Thomas Petazzoni
2024-04-07 17:37 ` Markus Wichmann [this message]
2024-04-07 19:50   ` Markus Wichmann
2024-04-08  2:18 ` Rich Felker
  -- strict thread matches above, loose matches on Subject: below --
2024-03-03 14:36 Thomas Petazzoni
2024-03-03 15:17 ` Rich Felker
2024-03-05 20:30   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZhLZv7xh5XnQpZxA@voyager \
    --to=nullplan@gmx.net \
    --cc=busybox@busybox.net \
    --cc=musl@lists.openwall.com \
    --cc=wbx@openadk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).