`Hiding' libc symbols (was Re: cvs commit: src/lib/libc/gen ...)
Andrey A. Chernov
ache at nagual.pp.ru
Thu May 1 08:15:08 PDT 2003
On Thu, May 01, 2003 at 09:53:45 -0500, Jacques A. Vidrine wrote:
>
> A libc consumer (getpwent.c):
> 587 namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1);
IMHO, it is bad hack at whole, and all namespace.h tricks should be
removed.
The reason is quite simple. Yes, you can save libc this way, but what
happens, if application linked, say, with libc AND libncurses (insert any
other system library here)? libc will be saved, but libncurses will not.
It means, to be logically, you need to replace strlcpy with _strlcpy in
ALL FreeBSD libraries. Better way is stop doing half-singing -
half-dancing and produce linker error when application attempts to replace
any function in standard namespace. It automatically makes impossible
broken binary-only packages.
So, I vote for namespace.h removing (i.e. all _ tricks). Who with me?
More information about the freebsd-arch
mailing list