qsort.3: Document mergesort() behaviour on size overflow

Signed-off-by:	Faraz Vahedi <kfv@kfv.io>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2243
Reviewed by:	fuz
MFC after:	1 week
This commit is contained in:
Faraz Vahedi
2026-06-02 12:42:59 +03:30
committed by Robert Clausecker
parent 3501eec9dd
commit 26a1180cd1
+11 -3
View File
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 25, 2024
.Dd June 2, 2026
.Dt QSORT 3
.Os
.Sh NAME
@@ -362,13 +362,21 @@ functions succeed unless:
.It Bq Er EINVAL
The
.Fa size
argument is zero, or,
argument is zero,
the
.Fa size
argument to
.Fn mergesort
is less than
.Dq "sizeof(void *) / 2" .
.Dq "sizeof(void *) / 2" ,
or
the
.Fa nmemb
and
.Fa size
arguments to
.Fn mergesort
describe an unrepresentable buffer size.
.It Bq Er ENOMEM
The
.Fn heapsort