mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Balazs Kezes <rlblaster@gmail.com>
To: musl@lists.openwall.com
Subject: qsort_r or qsort_s in musl
Date: Mon, 3 Sep 2018 21:57:05 +0100	[thread overview]
Message-ID: <20180903205705.GA7639@localhost> (raw)

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


             reply	other threads:[~2018-09-03 20:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 20:57 Balazs Kezes [this message]
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

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=20180903205705.GA7639@localhost \
    --to=rlblaster@gmail.com \
    --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).