Page MenuHomeFreeBSD

D47262.id145382.diff
No OneTemporary

D47262.id145382.diff

diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 19, 2023
+.Dd October 27, 2024
.Dt QSORT 3
.Os
.Sh NAME
@@ -333,16 +333,21 @@
.Sh COMPATIBILITY
The order of arguments for the comparison function used with
.Fn qsort_r
-is different from the one used by
-.Fn qsort_s ,
+is historically different from the one used by
+.Fn qsort_s
and the GNU libc implementation of
.Fn qsort_r .
-When porting software written for GNU libc, it is usually possible
-to replace
+However, as of
+.Fx 14.0 ,
+the
.Fn qsort_r
-with
-.Fn qsort_s
-to work around this problem.
+has been updated so that the
+.Fa thunk
+parameter appears last to match
+.St -p1003.1-2024 .
+Both the historical and the updated interfaces are now accepted
+via C11 generic selection and C++ polymorphism,
+but the updated interface is recommended for portable applications.
.Pp
.Fn qsort_s
is part of the
@@ -426,11 +431,15 @@
.Sh STANDARDS
The
.Fn qsort
-function
-conforms to
+function conforms to
.St -isoC .
+The
+.Fn qsort_r
+function conforms to
+.St -p1003.1-2024 .
+The
.Fn qsort_s
-conforms to
+function conforms to
.St -isoC-2011
K.3.6.3.2.
.Sh HISTORY
@@ -442,4 +451,5 @@
.Fx 14.0 ,
the prototype of
.Fn qsort_r
-was updated to match POSIX.
+was updated to match
+.St -p1003.1-2024 .

File Metadata

Mime Type
text/plain
Expires
Thu, May 1, 2:08 AM (17 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17870085
Default Alt Text
D47262.id145382.diff (1 KB)

Event Timeline