This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread sem_open : private glibc functions (__libc*


* Tone Kastlunger:

> Pardon my blatant ignorance;
> libpthread has interceptors?

Yes, it interposes many I/O-related functions:

Compare this (not linked with libpthread):

$ LD_DEBUG=bindings /usr/bin/applydeltarpm |& grep pwrite64
     16014:	binding file /usr/bin/applydeltarpm [0] to /lib64/libc.so.6 [0]: normal symbol `pwrite64' [GLIBC_2.2.5]

To this (linked with libpthread):

$ LD_DEBUG=bindings /usr/bin/perf |& grep pwrite64
     16031:	binding file /usr/bin/perf [0] to /lib64/libpthread.so.0 [0]: normal symbol `pwrite64' [GLIBC_2.2.5]

Depending on how these indirections are implemented, there is an
overhead at each call (IFUNCs are not supported on all targets, after
all).  Calling the libc implementation under a different name avoids the
indirection overhead.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]