From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7DF1F15800F for ; Thu, 19 Jan 2023 12:13:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7957DE0955; Thu, 19 Jan 2023 12:13:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0AFA3E0942 for ; Thu, 19 Jan 2023 12:13:40 +0000 (UTC) References: User-agent: mu4e 1.8.13; emacs 30.0.50 From: Arsen =?utf-8?Q?Arsenovi=C4=87?= To: gentoo-dev@lists.gentoo.org Cc: =?utf-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: Re: [gentoo-dev] Defining TZ in the base system profile? Date: Thu, 19 Jan 2023 13:11:54 +0100 In-reply-to: Message-ID: <86r0vq90y8.fsf@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Archives-Salt: b6ccb604-8e7b-49b0-a724-83fdbfbb23a2 X-Archives-Hash: 0213bf4b1c50b37a388e424bf1d3ff18 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Micha=C5=82 G=C3=B3rny writes: > On Wed, 2023-01-18 at 20:48 -0500, Joshua Kinard wrote: >> So this article[1] from 2017 popped up again on the tech radar via hacke= rnews[2] and a few other sites[3]. It=20 >> annotates how if the envvar TZ is undefined on a Linux system, it causes= glibc to generate a number of=20 >> additional syscalls, mainly stat-related calls (in my tests, newfstatat(= )). If defined to an actual value,=20 >> such as ":/etc/localtime" (or even an empty string), glibc will instead = generate far fewer, if any at all, of=20 >> these stat-related syscalls. >>=20 >> [...] >> So is adding a default definition of TZ to our base system /etc/profile = something we want to look at? I=20 >> haven't tried any other methods of benchmarking to see if not making tho= se additional syscalls is just placebo=20 >> or if there are actual impacts. Given how long this oddity has been aro= und, I can't tell if it's a genuine=20 >> bug in glibc, an unoptimized corner case, or just a big nothingburger. >>=20 > > Am I correct that there's no real difference between setting it to > ":/etc/localtime" and the actual timezone? > > I suppose it would make sense to default it. Correct, from ``(libc)TZ Variable'': If the =E2=80=98TZ=E2=80=99 environment variable does not have a value, = the operation chooses a time zone by default. In the GNU C Library, the default time zone is like the specification =E2=80=98TZ=3D:/etc/localtime=E2=80=99 (or =E2=80=98TZ=3D:/usr/local/etc/localtime=E2=80=99, depending on how the GNU = C Library was configured; *note Installation::). Other C libraries use their own rule for choosing the default time zone, so there is little we can say about them. I don't suspect any downside to this approach. =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOcEARYKAI8WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCY8kz718UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxEcYXJzZW5AZ2Vu dG9vLm9yZwAKCRBSwpQwHqLEkwtuAP4jFS+iRMTbEFT59j69vRIdXZl+QeXQxcpP xjZlJYCyCgD/eHJYmq4kbpxIkE1oXoybyVL/bVZjydYslTHg4GYBLQg= =mJ+Z -----END PGP SIGNATURE----- --=-=-=--