Add qsort_s(3). Apart from the constraints, it also makes it easier
to port software written for Linux variant of qsort_r(3).
Details
- Reviewers
kib arichardson delphij - Group Reviewers
manpages - Commits
- rS356909: Add qsort_s(3). Apart from the constraints, it also makes it easier
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
lib/libc/stdlib/qsort.3 | ||
---|---|---|
270 ↗ | (On Diff #66743) | May suggest some wordsmithing, for English readability?
(Assuming I interpreted the existing wording correctly; it's a little hard to follow, which is why I'm suggesting the re-wording.) |
328 ↗ | (On Diff #66743) | If the glibc version of qsort_r() is using non-standard ordering, perhaps note that? i.e. and the non-standard GNU libc implementation of |
lib/libc/stdlib/qsort.3 | ||
---|---|---|
328 ↗ | (On Diff #66743) | I wouldn't necessarily write that GNU is non-standard since the real problem is that there is no standard for qsort_r... I guess glibc just did whatever seemed easiest for their qsort. |
lib/libc/stdlib/qsort.c | ||
98 ↗ | (On Diff #66743) | void* context is the last argument for qsort_s |
lib/libc/stdlib/Symbol.map | ||
---|---|---|
123 ↗ | (On Diff #66743) | Where should it go instead? |
Looks fine to me but someone else should give the final approval.
include/stdlib.h | ||
---|---|---|
327 ↗ | (On Diff #66855) | Unrelated to this patch, but all other types use _FOO_DECLARED. Would be nice if we could be consistent. |
lib/libc/tests/stdlib/qsort_s_test.c | ||
76 ↗ | (On Diff #66855) | Should this check for == EINVAL instead of != 0? And the same for the other tests. |
lib/libc/tests/stdlib/qsort_s_test.c | ||
---|---|---|
76 ↗ | (On Diff #66855) | I don't think so - the standard doesn't seem to define the actual error to return? |
lib/libc/stdlib/Makefile.inc | ||
---|---|---|
14 ↗ | (On Diff #66896) | qsort_r.c is missing now. |
lib/libc/tests/stdlib/qsort_s_test.c | ||
---|---|---|
76 ↗ | (On Diff #66855) | True, I don't think we need to be testing the specific implementation here so we could theoretically reuse the test for other implementations. |
lib/libc/stdlib/Symbol.map | ||
---|---|---|
123 ↗ | (On Diff #66743) | I think looking at the other symbol.map files 1.6 is the version for 13? |
lib/libc/stdlib/Symbol.map | ||
---|---|---|
123 ↗ | (On Diff #66743) | Ah, now I get it. I only looked at this particular Symbol.map. |
Hmm, https://reviews.freebsd.org/D17083 proposes to change qsort_r() argument order to glibc's since that is likely to become POSIX standard and is slightly better than our order.