`Hiding' libc symbols
Peter Jeremy
peterjeremy at optushome.com.au
Tue May 6 02:25:40 PDT 2003
On Tue, May 06, 2003 at 09:46:12AM +0200, Harti Brandt wrote:
>On Mon, 5 May 2003, Jacques A. Vidrine wrote:
>JAV>So, I advocate hiding all symbols in libc by default. The Real World
>JAV>doesn't seem to care whether the symbols are defined by any standard or
>JAV>not.
>
>No. If I define my own printf() I want that printf to be called even by
>library internal calls.
What if I define my own printf() that doesn't fully implement all the
functionality of the FreeBSD printf()? It works meets all the requirements
for my code (and maybe even runs correctly elsewhere) but doesn't work
on FreeBSD because a library internal call (hypothetically) relies on
functionality that I don't need.
This is most likely to surface in functions like strlcpy(), strlcat()
and snprintf() where the return value includes a reference to the
size of the buffer that would be required to perform the requested
operation without truncation. This is the most likely area where an
implementor may cut corners if hir application does not rely on the
return value.
>The situation may be different for non-standardized functions with names
>in the application space like err().
Last time I checked, the base system included a program that included its
own err() function - with functionality substantially different to err(3).
Peter
More information about the freebsd-arch
mailing list