On Thu, Apr 22, 2010 at 11:33:34PM -0400, Glenn Fowler wrote:
> the _ast_ prefixes were added to libc names early on at the request
> of the solaris side
> 
> I believe this was for compatibility between objects compiled with
> and without ast headers
> 
> on other architectures the _ast_ prefix is only used on functions that
> defy interposing (some compiiation systems have a large set of intrinsic
> functions that infringe on libc)
> 
> "eventually this will bite someone" -- well there would be problems
> with and without the _ast_ prefix approach -- building without most
> of the _ast_ prefixes is done by one macro

There's a fair number of libc symbols that are safe to interpose on, as
long as the interposers provide the same semantics.  The allocator is
the main example (and, in fact, we often do interpose on the default
allocator, using LD_PRELOAD as well just by linking apps with libumem,
libwatchmalloc, etcetera), but not the only one.

Explicit interposition is safer than the _ast_ prefix alternative
because then you can be sure that all objects in the process will be
using the interposers (ignoring any additional interposers added via
LD_PRELOAD).  In the case of the allocator that means that there's no
chance of one allocator's free() being called to free memory allocated
by the other, or of two allocators stepping over the heap (they could
use mmap(), but many allocators still use brk()/sbrk()).

I'm quite curious as to why interposition was not used.  We'll have to
wait, evidently.  Best wishes to Roland,

Nico
-- 
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss

Reply via email to