<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2026-08-04T14:04:23Z</updated>
<entry>
<title>manuals: Fix more Fx and nearby mechanical typos</title>
<updated>2026-08-04T14:04:23Z</updated>
<author>
<name>Alexander Ziaee</name>
<email>ziaee@FreeBSD.org</email>
</author>
<published>2026-08-04T14:04:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=82c013fb59114b228cbc59536914be1c1772c69c'/>
<id>urn:sha1:82c013fb59114b228cbc59536914be1c1772c69c</id>
<content type='text'>
Fix compiler warnings related to the Fx macro, as well as all other
mechanical typos that were visible within one screenful of them. These
cause rendering glitches on various toolchains with various of the five
and a half decades of rich output formats and tooling manpages scale to.

The *x macro set specifies operating systems. These macros take the rest
of the line as an argument. Sometimes, a space was not used to separate
the argument of Fx and the trailing period. Others had other parts of
the sentence supplied as an argument to Fx.

While here, fix the other mechanical typos visible on those specific
screenfulls. Correct section typo AUTHOR to AUTHORS, markup utilities
with Sy, and apply line break after the end of a sentence.

PR:		297248
MFC after:	3 days
Reported by:	wosch (are you sure that's all of the broken Fx'es?)
Fixes:		ff2bc641599a ("Fix Fx and nearby mechanical typos")
Fixes:          d790b16bbf0c ("add man pages for stdbit functions")
Fixes:		6c57e368eb17 ("implement C23 memalignment()")
Fixes:		b06338167d64 ("ROUTE_MPATH and FIB_ALGO")
Fixes:		7e1affa242ca ("revise divert-to and divert-reply")
</content>
</entry>
<entry>
<title>libc: getopt{,_long}: Const correctness for C23</title>
<updated>2026-08-03T14:02:51Z</updated>
<author>
<name>Lexi Winter</name>
<email>ivy@FreeBSD.org</email>
</author>
<published>2026-08-03T14:02:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f1d98862044f7748c6f930e9d4339abc166a5b16'/>
<id>urn:sha1:f1d98862044f7748c6f930e9d4339abc166a5b16</id>
<content type='text'>
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer.  This breaks getopt during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

Since the pointed-to value is never modified, fix this by making
the pointer const.

MFC after:	1 week
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58488
</content>
</entry>
<entry>
<title>libc: Add strfromd, strfromf, and strfroml per C23</title>
<updated>2026-08-02T12:10:02Z</updated>
<author>
<name>Faraz Vahedi</name>
<email>kfv@kfv.io</email>
</author>
<published>2026-06-27T13:34:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f68d7bfc1479042184e09431bd55771c50c47f68'/>
<id>urn:sha1:f68d7bfc1479042184e09431bd55771c50c47f68</id>
<content type='text'>
strfromd(), strfromf(), and strfroml() are implemented directly
in terms of gdtoa.  If a non-conforming format string is passed,
the string "EDOOFUS" is returned and errno set to EDOOFUS as an
extension.

Reviewed by:	fuz
MFC after:	1 month
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/2301
Signed-off-by:	Faraz Vahedi &lt;kfv@kfv.io&gt;
</content>
</entry>
<entry>
<title>libc/merge.c: use memcpy() for copying</title>
<updated>2026-08-02T11:17:45Z</updated>
<author>
<name>Minsoo Choo</name>
<email>minsoochoo0122@proton.me</email>
</author>
<published>2026-07-02T19:47:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=00a79975c062650ba15e432e30776d42fc44fbaa'/>
<id>urn:sha1:00a79975c062650ba15e432e30776d42fc44fbaa</id>
<content type='text'>
Currently mergesort() uses ICOPY_*() to copy data as four byte blocks
instead of one byte. However, this is only achievable when both size and
base arguments are aligned to four bytes.

Use of memcpy() is ideal as 1) it is cleaner and 2) the library will use
SIMD for copying when the hardware supports it. Compared to ICOPY_*(),
SIMD can support up to 64 bytes. When the SIMD-backed memcpy() find the
address is unaligned, it can first copy data up to the nearest aligned
address, and then use SIMD operations for faster transfer. Thus memcpy()
can give better performance than mergesort()'s own implementation.

This is benchmarked on amd64 where there isn't a SIMD-backed
implementation yet. However, the baseline implementation in assembly
already delivers better performance in unaligned cases although there is
some performance drops in aligned cases. The benchmark results and
script is available in the Phabricator review. Ideally, more performance
improvements will come when amd64 gets SIMD implementation of memcpy().

Signed-off-by:	Minsoo Choo &lt;minsoochoo0122@proton.me&gt;
Reviewed by:	fuz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D58002
</content>
</entry>
<entry>
<title>system(3): Use plural form of 'command'</title>
<updated>2026-06-26T19:26:53Z</updated>
<author>
<name>Mathias Eggers</name>
<email>mathias.eggers@proton.me</email>
</author>
<published>2026-06-26T19:16:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=dcc684ddccd60d1079eefec06266de04641e319b'/>
<id>urn:sha1:dcc684ddccd60d1079eefec06266de04641e319b</id>
<content type='text'>
Pick the plural form in the sentence about running arbitrary commands in
the security consideration section.

PR:	    294497
Event:	    Halifax Hackathon 202606
Location:   Couch
</content>
</entry>
<entry>
<title>hcreate(3): fix incorrect claim that hdestroy frees keys</title>
<updated>2026-06-10T12:35:05Z</updated>
<author>
<name>Kit Dallege</name>
<email>xaum.io@gmail.com</email>
</author>
<published>2026-03-27T01:57:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1'/>
<id>urn:sha1:ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1</id>
<content type='text'>
The man page incorrectly stated that hdestroy() calls free(3) for
each comparison key. The implementation (hdestroy_r.c) only frees
the internal table structure, not the user-provided keys or data.
This matches POSIX, which says hdestroy "shall dispose of the
search table" without mentioning key deallocation.

Update the description to clarify that the caller is responsible
for freeing any memory associated with table entries.

PR: 291240
Signed-off-by: Kit Dallege &lt;xaum.io@gmail.com&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2095
</content>
</entry>
<entry>
<title>libc: Add free_sized() and free_aligned_sized() as per C23</title>
<updated>2026-06-07T20:59:19Z</updated>
<author>
<name>Faraz Vahedi</name>
<email>kfv@kfv.io</email>
</author>
<published>2026-05-16T18:36:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5f732742ad5b3133a860a8969cf2bd13dc9ac358'/>
<id>urn:sha1:5f732742ad5b3133a860a8969cf2bd13dc9ac358</id>
<content type='text'>
Add C23 sized deallocation entry points as thin wrappers around free(3).
Implementations may ignore size and alignment hints, so behaviour stays
correct for existing allocations without validating caller metadata yet.

When jemalloc is updated to 5.3.1, rewire these to je_free_sized() and
je_free_aligned_sized() so deallocation can use the allocator's sized
deallocation (free_sized for fast paths and free_aligned_sized for
correct aligned hints.)

Please note this change satisfies the standard interface only. Both
functions should be delegated to jemalloc after the upgrade so callers
get the intended allocator behaviour; until then, hints are unused and
neither sized nor aligned-sized deallocation optimizations apply.

Signed-off-by:	Faraz Vahedi &lt;kfv@kfv.io&gt;
Reviewed by:	fuz
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2201
MFC after:	1 month
</content>
</entry>
<entry>
<title>qsort.3: Document mergesort() behaviour on size overflow</title>
<updated>2026-06-07T20:59:19Z</updated>
<author>
<name>Faraz Vahedi</name>
<email>kfv@kfv.io</email>
</author>
<published>2026-06-02T09:12:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=26a1180cd1521e4c438ac95a57b134e27ea0a72d'/>
<id>urn:sha1:26a1180cd1521e4c438ac95a57b134e27ea0a72d</id>
<content type='text'>
Signed-off-by:	Faraz Vahedi &lt;kfv@kfv.io&gt;
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2243
Reviewed by:	fuz
MFC after:	1 week
</content>
</entry>
<entry>
<title>libc: Guard mergesort() allocation size arithmetic</title>
<updated>2026-06-07T20:59:18Z</updated>
<author>
<name>Faraz Vahedi</name>
<email>kfv@kfv.io</email>
</author>
<published>2026-05-28T13:50:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3501eec9dd39b527a46e82de53480968d283b90e'/>
<id>urn:sha1:3501eec9dd39b527a46e82de53480968d283b90e</id>
<content type='text'>
Signed-off-by:	Faraz Vahedi &lt;kfv@kfv.io&gt;
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2243
Reviewed by:	fuz
MFC after:	1 week
</content>
</entry>
<entry>
<title>rand(3): Normalize function ordering</title>
<updated>2026-05-30T19:07:29Z</updated>
<author>
<name>Aymeric Wibo</name>
<email>obiwac@FreeBSD.org</email>
</author>
<published>2026-05-30T19:00:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eda74fe47993f1d62e7c110850def6960b55291e'/>
<id>urn:sha1:eda74fe47993f1d62e7c110850def6960b55291e</id>
<content type='text'>
Align ordering between NAME &amp; SYNOPSIS sections.

Obtained from:	https://github.com/apple-oss-distributions/libc
Sponsored by:	Klara, Inc.
</content>
</entry>
</feed>
