From nobody Mon Sep 29 05:19:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cZqHk0rXFz68vGT; Mon, 29 Sep 2025 05:19:30 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cZqHk042sz42J6; Mon, 29 Sep 2025 05:19:30 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759123170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zVe1MmbsVV7AdYqlW5jQ1Tfa6EY8LNYvQYMTTN29yPA=; b=jxV4hwxv0AUTHuq+qvgdbnduPUei5WEKbFPPG7QcMVxFzYd9xGqFPG3mPaPt5d+cy2iMjj 56Xb3rAksMzeg4lu7O2HCF2hGVD7ygUKH99Edz5Sv6c/gFwTEDj8pA+w4Jmq+kgT4xAr1n 3EGyHaOGDzzXw1xV1T3rm/z5ORiLF1DpkEcOi5Wr4SKlH8p2OK0RM9FGEj9mjrOJpfQaKV nEiTrgpnSFg28/8cxhZAYY29AIvOy3xPGc84y1X4ocYTNS6A1chCqQRL+iDy/HyiNK8OQ1 JqlVEwVFhVt+1DMbovWe79iwzu2sB6QbsujtgRsuVUS9TrSe27RJmcRw2lp32A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759123170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zVe1MmbsVV7AdYqlW5jQ1Tfa6EY8LNYvQYMTTN29yPA=; b=kBZnVA5VHXWqIzYieV/VWWMNPcxXlhr5Hv2kWblPDoF+5AqE4Wv2nyFh3HrLA+oiWZISBP ZxxVsFXHPqv9x168aYtDUl1o8gxIwNlKQvYZnWhtqoiqzdpr+h7kB37cyE87LsPxvOM3AB eKuqQ4H02bn65QM8M2iND0e5slfBi4YbspFTv11MUEhrjgIcrl2fRiWzGlk3zO8/eiP3rx JEZX2iGQRVKYj1NHVtiLJFziTPsJFMicT3n8v+U2+QCD1aF7AGOxVz89NKUCOYvoPmi/GZ f+OoVltXpebNBd+sVNlCKEutoIgLTFDg/qE4TRNlNF7vZhMtaaihAlAJbkJNmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759123170; a=rsa-sha256; cv=none; b=yZnxezbESo1LfzHzEJDaCgdSxmJzV9L0NjTwKltD22fK4okBCbcT6XU2VgqnkBi3dyh2Q6 32SlWn/PmYcSY2pfnDMsKlS2HruQmh/aoSm7LPwUX+FF2AAduWADER3aarId6fdqVwOw26 v4ja86NFSih17JskJO9x/ncMK1dRp7tYngZ+zKAuVgax37DeB+kfVc+nn1FbmFDpMhcrBi 8m/W7C3AZC/89k3s/NZCF6XSrjRulpKqli6Ftu4UkKV2rph4Z611RFPXFV5rYVBbRh3ihi 2Gs4S8bU0LbKQR0n8GpkoiMcpjQ0FIiMq5hdFoaNSOXmNImhlkgEKd7uwiG2ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from ltc.des.dev (88-177-82-251.subs.proxad.net [88.177.82.251]) (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) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cZqHj60Jmz18h9; Mon, 29 Sep 2025 05:19:29 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 999644BECF; Mon, 29 Sep 2025 07:19:28 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d58339f39874 - main - tzcode: Drop libc namespace In-Reply-To: (Konstantin Belousov's message of "Mon, 29 Sep 2025 03:59:03 +0300") References: <202509271707.58RH7ajb090983@gitrepo.freebsd.org> <86frc6bzcm.fsf@ltc.des.dev> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 29 Sep 2025 07:19:28 +0200 Message-ID: <86zfadal9b.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Konstantin Belousov writes: > Dag-Erling Sm=C3=B8rgrav writes: > > If we really want to do what you suggest, there are better > > ways (like what macOS does). > I have no idea about MacOS/what is used by Mach-O. Can you provide some > hints or links, please? They use macros in the header that contains the prototype to rename functions when there are multiple variants. In our case it would look like this: (in sys/sys/cdefs.h) #ifdef __LIBC #define __LIBC_SYM(sym) __asm("_" #sym) #else #define __LIBC_SYM(sym) #endif __LIBC (in include/fcntl.h) int open(const char *, int, ...) __LIBC_SYM(open); (in lib/lib{c,sys,thr}/Makefile) CFLAGS+=3D-D__LIBC This allows code in libc to use open() instead of _open() and not have to worry about needing to include "namespace.h" and "un-namespace.h" in the right places. It also means simply adding __LIBC to any prototype (and a __weak_reference in the correct place) automatically protects every call to that function in lib{c,sys,thr} without having to chase them all down. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org