Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Sep 2018 21:57:05 +0100
From: Balazs Kezes <>
Subject: qsort_r or qsort_s in musl


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:

qsort_r differs between bsd/osx and glibc though:

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,

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.