mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: [musl] Promoting extension functions up from _GNU_SOURCE ?
Date: Mon, 27 Sep 2021 19:35:15 -0400	[thread overview]
Message-ID: <20210927233515.GA4428@brightrain.aerifal.cx> (raw)

In a related discussion on IRC, and in light of merging qsort_r, I
noticed that memmem and likely a large number of other functions that
we share with the BSDs are only exposed under _GNU_SOURCE. This seems
wrong. In some cases that's what glibc is doing too, but that's not a
very good reason to do the same. Some of these, like memmem and
qsort_r, are even approved for the next issue of POSIX.

I think it makes sense to start by making a list of functions that are
presently _GNU_SOURCE that the BSDs also have, and then, as long as
they are useful (as opposed to legacy junk) functions we want to treat
as well-supported functionality, and as long as the names are not
problematic, plan to move most or all to _BSD_SOURCE (default
exposure).

For the ones that are POSIX-future, we could go ahead and move them to
baseline _POSIX_C_SOURCE, or wait a bit. Note that we already have
some POSIX-future functions like dup3 and pipe2 exposed that way. For
ones that are in a reserved namespace (like memmem, which matches the
mem* reservation for string.h) I think it'd be very reasonable to move
them right away. For the others, we should probably look at possible
consequences.

Does this sound reasonable? Any volunteers to make such a list?

             reply	other threads:[~2021-09-27 23:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 23:35 Rich Felker [this message]
2021-09-28  5:20 ` Quentin Rameau
2021-09-28 12:39   ` Rich Felker
2021-09-28 17:04     ` Quentin Rameau

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=20210927233515.GA4428@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).