mailing list of musl libc
 help / color / mirror / code / Atom feed
* About those weak aliases
@ 2019-09-02 19:04 Markus Wichmann
  2019-09-02 20:10 ` Szabolcs Nagy
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Wichmann @ 2019-09-02 19:04 UTC (permalink / raw)
  To: musl

Hi all,

I'd like to know what those weak aliases are for in the many cases where
they are used to define a public interface. Or, more to the point, by
what criteria they are handed out, and by what logic the internal
symbols are used.

For instance, pthread_mutex_lock() et al. are weakly defined, but
pthread_cond_wait() is not. Unlike pthread_cond_timedwait(), which is
called from pthread_cond_wait() by the public symbol that might be
interposed. Makes sense, since pthread_cond_wait() does not depend on
mutex internals (pthread_cond_timedwait() does).

I found no C standard function with a weak definition. But I did find
crypt() being strongly defined, but it calls the internal (strong)
definition of crypt_r(), rather than the weak one.

So I thought maybe the C standard functions get strong definitions and
all others get weak ones. But open(), close(), etc. are also defined
strongly, while fdopen() gets a weak definition. And those are all in
POSIX. Meanwhile, adjtime() gets a strong definition, as does
getdents(), and those are Linux specialities.

So yeah,I have so far failed to identify any rhyme or reason to these
definitions. Can anyone help me?

Ciao,
Markus


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-05 18:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 19:04 About those weak aliases Markus Wichmann
2019-09-02 20:10 ` Szabolcs Nagy
2019-09-02 23:01   ` Rich Felker
2019-09-03 10:13     ` Szabolcs Nagy
2019-09-03 12:08       ` Rich Felker
2019-09-05 16:50   ` Markus Wichmann
2019-09-05 16:58     ` Szabolcs Nagy
2019-09-05 17:29       ` Markus Wichmann
2019-09-05 18:18         ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).