From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/nolibc: rename sys_foo() functions to _sys_foo()
Date: Sun, 22 Mar 2026 10:06:42 +0100 [thread overview]
Message-ID: <ab-xIgENyZHgqoCK@1wt.eu> (raw)
In-Reply-To: <20260319-nolibc-namespacing-v1-1-33c22eaddb5e@weissschuh.net>
Hi Thomas,
On Thu, Mar 19, 2026 at 05:20:17PM +0100, Thomas Weißschuh wrote:
> The sys_foo() naming scheme used by the syscall wrappers may collide
> with application symbols. Especially as 'sys_' is an obvious naming
> scheme an application may choose for its own custom systemcall wrappers.
Yes but on the other hand it might implement it when missing the one
offered by the libc.
> Avoid these conflicts by using an leading underscore which moves the
> names into the implementation's namespace. This naming scheme was chosen
> over a '__nolibc_' prefix, as these functions are not an implementation
> detail but a documented interface meant to be used by applications.
Agreed.
> While this may break some existing users, adapting them should be
> straightforward. Given that nolibc is most-likely vendored, no
> unexpected breakage should happen. No in-tree users are affected.
I also checked in my local stuff (preinit, watchdog daemon etc) and
didn't find any user of sys_*.
> These conflicts happen when compiling some of the kernel selftests
> with nolibc.
You mean some of the syscall entry points ? If so, I'm seeing one
exception of _sys_rt_sigreturn(), not convinced it could be an issue
though.
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> I am not really thrilled about breaking these names.
> But every other option seems to be horribly to maintain
> or will break sooner or later anyways.
> Any ideas?
I think your approach is reasonable for the reasons you explained. Yes we
do want to continue to export these, and they're not supposed to be spread
all over application code, so changes if any should be very limited. So:
Acked-by: Willy Tarreau <w@1wt.eu>
On a related topic, I've been thinking several times about how to discover
support or not of a syscall in nolibc by the application, especially since
the lib improves fast and applications might not want to wait for it to
support a new syscall, and end up with their own as you suggested above.
Maybe this _sys_foo thing could be the opportunity for us to generalize
the systematic addition of:
#define _sys_foo _sys_foo
before every definition, so that application can simply use #ifndef to
define their own local version. There's no emergency, it's been that way
for years, I'm sharing it just as food for thought.
Cheers,
Willy
next prev parent reply other threads:[~2026-03-22 9:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 16:20 Thomas Weißschuh
2026-03-22 9:06 ` Willy Tarreau [this message]
2026-03-22 10:43 ` Thomas Weißschuh
2026-03-22 11:03 ` Willy Tarreau
2026-03-24 17:01 ` Thomas Weißschuh
2026-03-29 5:06 ` Willy Tarreau
2026-04-04 14:29 ` Thomas Weißschuh
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=ab-xIgENyZHgqoCK@1wt.eu \
--to=w@1wt.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®