Re: git: d58339f39874 - main - tzcode: Drop libc namespace

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Sun, 28 Sep 2025 11:17:29 UTC
Konstantin Belousov <kostikbel@gmail.com> writes:
> It does change the behavior.  Now a user-provided open/fstat/pthread_*
> functions can interpose the system functions, making tz code doing something
> that was not intended.
>
> In other words, namespacing guaranteed that tzcode was not affected by
> the app playing with libc namespace.

That is a side effect of namespace.h but not its original purpose, which
was to allow libc to call pthread functions, which would be stubbed out
when libc_r was not loaded.  This is no longer needed, and namespace.h
has bitrotted and is missing a bunch of syscalls and functions
(including nearly every *at() system call, with the sole exception of
openat()).  If we really want to do what you suggest, there are better
ways (like what macOS does).

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org