`Hiding' libc symbols

Jacques A. Vidrine nectar at FreeBSD.org
Tue May 6 09:23:53 PDT 2003


On Tue, May 06, 2003 at 05:53:16PM +0200, Harti Brandt wrote:
> JAV>Or stated more agressively, the day the FreeBSD toolchain refuses
> JAV>to allow me to define my own version of strlcpy _for use by my
> JAV>application_ is the day I find another development platform.
> 
> So if you 'hide' all the libc symbols you will to exactly that. 

Of course not.  I can define strlcpy like so

  void
  strlcpy(struct string *a, struct string *b)
  {
	  if (a->size == 0) {
		  b->size = 0;
		  return;
	  }
	  /* really copy the string */
  }

if I want to, and my application will then behave exactly as my insane
mind expects.  (this is just a sillier example of the real world
problem that was encountered)

However, since strlcpy is _not_ protected/hidden today, my application
as a whole will likely not behave as I expect.  I'll innocently call
something like getaddrinfo() and *BOOM*. :-)

Cheers,
-- 
Jacques Vidrine   . NTT/Verio SME      . FreeBSD UNIX       . Heimdal
nectar at celabo.org . jvidrine at verio.net . nectar at freebsd.org . nectar at kth.se


More information about the freebsd-arch mailing list