mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: About those weak aliases
Date: Mon, 2 Sep 2019 21:04:48 +0200	[thread overview]
Message-ID: <20190902190359.GA6472@voyager> (raw)

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


             reply	other threads:[~2019-09-02 19:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 19:04 Markus Wichmann [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902190359.GA6472@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).