From nobody Tue Feb 17 13:17:08 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fFgCn1J8fz6SQ1r for ; Tue, 17 Feb 2026 13:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fFgCm4js3z3kwj for ; Tue, 17 Feb 2026 13:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771334228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7R9YOHRhYIRBOLD+ucVSEOhQQIhbFNaU32ZPwyfWE0=; b=FfMfDPjJT2OyHW3bwYPac0tQY0/oJ4prfgMpUkb9OGGBuUab/scodrc1JNKw9/ee53EWzk RVg7eKHPYHN4QUsrBpxPR0qCMGpoJZz/pogJau8flMQ/vRznD/7ANdY3IEurX5ePdO9ri6 TPCa/mJ0oIEKjS0PQp30oPkwcKje66m9nA3TaA+GLfhtQH2Lc6ECDJxh7aSlRQJ8BVN+9A snxGpuAmADaOkGqf8cuZPxypLrzrwB6D0/MYLmJZ8FuXQAPPSgHLQMLUJZWbRfLIEJEwG8 HFABNNaFPvNSW12SD636WV8g/PZh/Sro0J1Wp5O6rJiErX0aC3I+k8PJV+ljow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771334228; a=rsa-sha256; cv=none; b=ZiHO+xcunjBZ2RKmwsISf2VV2NlqaUtaBriJQl0f9rui2O86karMUCqGOdSSDL/D9eSxOB P7zoIleL5r8IuMJ1E/k1tjbgSj+Uj8nuQ/r2OxDHEP8TGdbl6MLdOvwVC5qaVi7CfztEjy NiE9HbyMk+ZHEHDXVOTiTghtdK38MbBxSpnw0FX3TE/rlf8hEUNuXvaFSoGZTjbb1rp51k 6huwlNNoJDR5V9jKVK/maT4sq/GDeX8uc8SrKry3Eg2Gt+UXL6Tm5cDQoowkiIxt+l4FrU c+RjoIgIu/aURUyLqOuCN4HXYp2H7QXlcQhg5fyopvVbScEK2HL0HWzFiDhQ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771334228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7R9YOHRhYIRBOLD+ucVSEOhQQIhbFNaU32ZPwyfWE0=; b=yf7S7UlJ8FNezm91y7qtMDGQzSEHAQNGPPElhOU6NO8ungk9OiaQhT2zyUlQu+DsrCYuZs qHfybVezKppo1XU3kOv6pE+lgVVWqv8e/KyFymUOntl7ggWIRcMzd27n5mnNelV1KOGP2b 93xET77/5heIMwx37pDQ7Xbo5BmaZhKb4QL2FytGLpr0dSheMhfCvU7SgaZax363jj/HN9 BgqWxbxUxdFqZCKd5bs545efJq0JVrZOtGSLXj+9ZvAhCkk7o4fwC75nfEG7b/sVrLlHxF Zt3UzijiUSrDxADrnH95AqaE1EU9F9sQmfJbDK3xYUC1LMZmUOIZpqasjwiQWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fFgCm48Vvz19vF for ; Tue, 17 Feb 2026 13:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f3ca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Feb 2026 13:17:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Aymeric Wibo Subject: git: b6279be747fa - stable/15 - libc: Improve {,l,ll,imax}div(3) manpages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b6279be747facd85eb4490fc874148fede854d03 Auto-Submitted: auto-generated Date: Tue, 17 Feb 2026 13:17:08 +0000 Message-Id: <69946a54.3f3ca.4d461241@gitrepo.freebsd.org> The branch stable/15 has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=b6279be747facd85eb4490fc874148fede854d03 commit b6279be747facd85eb4490fc874148fede854d03 Author: Aymeric Wibo AuthorDate: 2026-02-12 14:50:19 +0000 Commit: Aymeric Wibo CommitDate: 2026-02-17 13:16:20 +0000 libc: Improve {,l,ll,imax}div(3) manpages Mainly rename numerator parameter of div(3) and ldiv(3) from num to numer, and explicitly specify what "numer", "denom", and "rem" mean in the manpages. MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc (partially) Sponsored by: Klara, Inc. (cherry picked from commit 0bba277f2223a31e4453ade39be110b1b3aeb1dd) --- lib/libc/stdlib/div.3 | 14 ++++++++------ lib/libc/stdlib/div.c | 6 +++--- lib/libc/stdlib/imaxdiv.3 | 6 +++--- lib/libc/stdlib/ldiv.3 | 14 ++++++++------ lib/libc/stdlib/ldiv.c | 8 +++----- lib/libc/stdlib/lldiv.3 | 6 +++--- 6 files changed, 28 insertions(+), 26 deletions(-) diff --git a/lib/libc/stdlib/div.3 b/lib/libc/stdlib/div.3 index 55c1bd107cb7..87b9665684fb 100644 --- a/lib/libc/stdlib/div.3 +++ b/lib/libc/stdlib/div.3 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt DIV 3 .Os .Sh NAME @@ -38,21 +38,23 @@ .Sh SYNOPSIS .In stdlib.h .Ft div_t -.Fn div "int num" "int denom" +.Fn div "int numer" "int denom" .Sh DESCRIPTION The .Fn div function computes the value -.Fa num/denom -and returns the quotient and remainder in a structure named +.Fa numer Ns / Ns Fa denom +(numerator/denominator). +It returns a structure named .Fa div_t that contains two .Vt int members named .Va quot -and -.Va rem . +(quotient) and +.Va rem +(remainder). .Sh SEE ALSO .Xr imaxdiv 3 , .Xr ldiv 3 , diff --git a/lib/libc/stdlib/div.c b/lib/libc/stdlib/div.c index 351dca870553..cdc6e1922060 100644 --- a/lib/libc/stdlib/div.c +++ b/lib/libc/stdlib/div.c @@ -35,12 +35,12 @@ #include /* div_t */ div_t -div(int num, int denom) +div(int numer, int denom) { div_t r; - r.quot = num / denom; - r.rem = num % denom; + r.quot = numer / denom; + r.rem = numer % denom; return (r); } diff --git a/lib/libc/stdlib/imaxdiv.3 b/lib/libc/stdlib/imaxdiv.3 index 1553a81edae2..9e51c47b53c3 100644 --- a/lib/libc/stdlib/imaxdiv.3 +++ b/lib/libc/stdlib/imaxdiv.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt IMAXDIV 3 .Os .Sh NAME @@ -39,9 +39,9 @@ The .Fn imaxdiv function computes the value of .Fa numer -divided by +(numerator) divided by .Fa denom -and returns the stored result in the form of the +(denominator) and returns the stored result in the form of the .Vt imaxdiv_t type. .Pp diff --git a/lib/libc/stdlib/ldiv.3 b/lib/libc/stdlib/ldiv.3 index 66abb00d4d6c..c2ab444bdcab 100644 --- a/lib/libc/stdlib/ldiv.3 +++ b/lib/libc/stdlib/ldiv.3 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 3, 2022 +.Dd February 12, 2026 .Dt LDIV 3 .Os .Sh NAME @@ -40,21 +40,23 @@ .Sh SYNOPSIS .In stdlib.h .Ft ldiv_t -.Fn ldiv "long num" "long denom" +.Fn ldiv "long numer" "long denom" .Sh DESCRIPTION The .Fn ldiv function computes the value -.Fa num Ns / Ns Fa denom -and returns the quotient and remainder in a structure named +.Fa numer Ns / Ns Fa denom +(numerator/denominator). +It returns the quotient and remainder in a structure named .Vt ldiv_t that contains two .Vt long members named .Va quot -and -.Va rem . +(quotient) and +.Va rem +(remainder). .Sh SEE ALSO .Xr div 3 , .Xr imaxdiv 3 , diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c index 4c73bcc14af4..4e92c56dd3e2 100644 --- a/lib/libc/stdlib/ldiv.c +++ b/lib/libc/stdlib/ldiv.c @@ -35,14 +35,12 @@ #include /* ldiv_t */ ldiv_t -ldiv(long num, long denom) +ldiv(long numer, long denom) { ldiv_t r; - /* see div.c for comments */ - - r.quot = num / denom; - r.rem = num % denom; + r.quot = numer / denom; + r.rem = numer % denom; return (r); } diff --git a/lib/libc/stdlib/lldiv.3 b/lib/libc/stdlib/lldiv.3 index d1de4e9234e3..783ea3df6554 100644 --- a/lib/libc/stdlib/lldiv.3 +++ b/lib/libc/stdlib/lldiv.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt LLDIV 3 .Os .Sh NAME @@ -39,9 +39,9 @@ The .Fn lldiv function computes the value of .Fa numer -divided by +(numerator) divided by .Fa denom -and returns the stored result in the form of the +(denominator) and returns the stored result in the form of the .Vt lldiv_t type. .Pp