mailing list of musl libc
 help / color / mirror / code / Atom feed
* qsort_r or qsort_s in musl
@ 2018-09-03 20:57 Balazs Kezes
  2018-09-03 22:53 ` Rich Felker
  0 siblings, 1 reply; 10+ messages in thread
From: Balazs Kezes @ 2018-09-03 20:57 UTC (permalink / raw)
  To: musl

Hi!

I can find a lot of discussions on the web around qsort_r and the pain that musl
lacks it but I can't find any official word on this from musl devs. If there is
one, could src/stdlib/qsort.c contain a pointer to it?

Are there any plans having one of them in musl? I'd prefer qsort_r since that
would provide greater compatibility with glibc. I even found patches for it:
https://gist.github.com/izabera/e68927258ad2d29a1586bad276fabcab
https://github.com/esmil/musl/commit/194f9cf93da8ae62491b7386edf481ea8565ae4e

qsort_r differs between bsd/osx and glibc though:
https://sourceware.org/ml/libc-alpha/2008-12/msg00003.html

The argument for qsort_s is that it is in the C11 standard as an optional
feature and has similar interface as glibc's qsort_r.

To avoid choosing sides it could be even qsort_musl for all I care. I could then
use preprocessor to choose the right version. I know there are many workarounds:
global variables, thread local variables, copy pasting and changing qsort from
musl in my own source tree, using glibc. None of them feel right.

Any thoughts?

Please CC me on the replies.

Thank you,
Balazs


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

end of thread, other threads:[~2018-09-10 17:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 20:57 qsort_r or qsort_s in musl Balazs Kezes
2018-09-03 22:53 ` Rich Felker
2018-09-04  7:41   ` Balazs Kezes
2018-09-04 14:48     ` Eric Blake
2018-09-04 15:18       ` Rich Felker
2018-09-04 15:45         ` Balazs Kezes
2018-09-04 15:45         ` Leah Neukirchen
2018-09-04 16:13           ` Rich Felker
2018-09-10 17:27   ` Ed Maste
2018-09-10 17:43     ` 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).