mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Nicholas Wilson <nicholas.wilson@realvnc.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: Feature request: building musl in a portable way
Date: Fri, 22 Dec 2017 19:06:17 +0000	[thread overview]
Message-ID: <AM6PR0502MB387812D8320968DC10B062F9E7020@AM6PR0502MB3878.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20171222180832.GD1627@brightrain.aerifal.cx>

On 22 December 2017 18:08, Rich Felker wrote:
> Wouldn't just exporting a TZ variable be easier?

(Sorry ardi for hijacking your thread! Just a brief response.)

That gives you the current timezone, true. But to make localtime() work, you of course need historical timezone information - a list of timestamps when the timezone offset changed. Getting that information from the browser is actually rather hard. Of course the browser internally has the list of timezone data, but it doesn't expose it via an API - all you can do is basically call a JavaScript equivalent of localtime() and find the timezone offset at specific points you sample. So we can't easily extract the current timezone's full data, and use Musl's implementation. Our current solution is simple, and does a wholesale redirection of localtime() to a browser-based version. Implementing localtime() in a browser is easy, but extracting zoneinfo is hard.

Nick

  reply	other threads:[~2017-12-22 19:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 16:25 ardi
2017-12-21 21:38 ` Rich Felker
2017-12-22 16:09   ` ardi
2017-12-22 16:43     ` Rich Felker
2017-12-22 19:04       ` ardi
2017-12-23  8:18         ` Markus Wichmann
2017-12-23 20:57           ` ardi
2017-12-22 17:10     ` Nicholas Wilson
2017-12-22 17:49       ` Rich Felker
2017-12-22 18:01         ` Nicholas Wilson
2017-12-22 18:08           ` Rich Felker
2017-12-22 19:06             ` Nicholas Wilson [this message]
2017-12-22 19:27       ` ardi

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=AM6PR0502MB387812D8320968DC10B062F9E7020@AM6PR0502MB3878.eurprd05.prod.outlook.com \
    --to=nicholas.wilson@realvnc.com \
    --cc=musl@lists.openwall.com \
    /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).