Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 27 Sep 2021 19:35:15 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Promoting extension functions up from _GNU_SOURCE ?

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?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.