<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib/Makefile.inc, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-16T18:16:51Z</updated>
<entry>
<title>libc: regoranize malloc build</title>
<updated>2023-08-16T18:16:51Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-08-16T18:16:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c5f49ece16a92380092191fad13cb1da72af5d37'/>
<id>urn:sha1:c5f49ece16a92380092191fad13cb1da72af5d37</id>
<content type='text'>
Create a stdlib/malloc to hold the definition of the malloc interface
(e.g., the Symbol.map file) and make jemalloc a subdirectory.  This will
make it easier to integrate alternative allocators such as snmalloc
while making it clear that the current jemalloc symbols are the FreeBSD
API/ABI (for better or worse).

Suggested by:	jrtc27
Reviewed by:	jrtc27, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41457
</content>
</entry>
<entry>
<title>libc: include malloc via stdlib/Makefile.inc</title>
<updated>2023-08-16T18:16:26Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2023-08-16T18:16:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4c757938e4f28adfd57cc1e7271c2dd174d0ce9e'/>
<id>urn:sha1:4c757938e4f28adfd57cc1e7271c2dd174d0ce9e</id>
<content type='text'>
There's a hierarchy here and we should use it.

Improves: cbeacb7c46f3a3650e5dbefa9a1a18bc9943a8cc

Reviewed by:	jrtc27, jhb, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41456
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>urn:sha1:d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>Revert "libc: Implement bsort(3) a bitonic type of sorting algorithm."</title>
<updated>2023-04-20T17:16:14Z</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2023-04-20T16:50:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bb8e8e230d94c9522bd9ff95c13dc9f5b1592929'/>
<id>urn:sha1:bb8e8e230d94c9522bd9ff95c13dc9f5b1592929</id>
<content type='text'>
Some points for the future:
 - libc is not the right place for sorting algorithms.
   Probably libutil is better suited for this purpose or
   a dedicated libsort. Should move all sorting algorithms
   away from libc eventually.
 - CheriBSD uses capabilities for memory access, and could
   benefit from a standard memswap() function.
 - Do something about qsort() in FreeBSD's libc like:
   - Mark it deprecated on FreeBSD, as a first step,
     due to missing limits on CPU time.
   - Audit the use of qsort() in the FreeBSD base system
     and consider swapping to other existing sorting
     algorithms.

Discussed with:	brooks@

Differential Revision:	https://reviews.freebsd.org/D36493

This reverts commit a7469c9c0a504a5e6e9b89e148cd78df5e67ff7f.
This reverts commit 7d65a450cdcc7cc743f2ecd114ba3428a21c0033.
This reverts commit 8dcf3a82c54cb216df3213a013047907636a01da.
</content>
</entry>
<entry>
<title>libc: Implement bsort(3) a bitonic type of sorting algorithm.</title>
<updated>2023-04-19T12:04:22Z</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2022-09-08T10:16:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8dcf3a82c54cb216df3213a013047907636a01da'/>
<id>urn:sha1:8dcf3a82c54cb216df3213a013047907636a01da</id>
<content type='text'>
The bsort(3) algorithm works by swapping objects, similarly to qsort(3),
and does not require any significant amount of additional memory.

The bsort(3) algorithm doesn't suffer from the processing time issues
known the plague the qsort(3) family of algorithms, and is bounded by
a complexity of O(log2(N) * log2(N) * N), where N is the number of
elements in the sorting array. The additional complexity compared to
mergesort(3) is a fair tradeoff in situations where no memory may
be allocated.

The bsort(3) APIs are identical to those of qsort(3), allowing for
easy drop-in and testing.

The design of the bsort(3) algorithm allows for future parallell CPU
execution when sorting arrays. The current version of the bsort(3)
algorithm is single threaded. This is possible because fixed areas
of the sorting data is compared at a time, and can easily be divided
among different CPU's to sort large arrays faster.

Reviewed by:	gbe@, delphij@, pauamma_gundo.com (manpages)
Sponsored by:	NVIDIA Networking
Differential Revision:	https://reviews.freebsd.org/D36493
</content>
</entry>
<entry>
<title>Add GNU glibc compatible secure_getenv</title>
<updated>2023-03-14T04:19:24Z</updated>
<author>
<name>lucy</name>
<email>seafork@disroot.org</email>
</author>
<published>2023-03-13T22:01:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4'/>
<id>urn:sha1:adeca21464d25bc61f98968a5c1e76ab3c808ae4</id>
<content type='text'>
Add mostly glibc and msl compatible secure_getenv. Return NULL if
issetugid() indicates the process is tainted, otherwise getenv(x).  The
rational behind this is the fact that many Linux applications use this
function instead of getenv() as it's widely consider a, "best
practice".

Reviewed by: imp, mjg (feedback)
Pull Request: https://github.com/freebsd/freebsd-src/pull/686
Signed-off-by: Lucy Marsh &lt;seafork@disroot.org&gt;
</content>
</entry>
<entry>
<title>Alter the prototype of qsort_r(3) to match POSIX, which adopted the</title>
<updated>2022-09-30T22:26:30Z</updated>
<author>
<name>Ed Schouten</name>
<email>ed@FreeBSD.org</email>
</author>
<published>2022-09-30T22:26:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a'/>
<id>urn:sha1:af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a</id>
<content type='text'>
glibc-based interface.

Unfortunately, the glibc maintainers, despite knowing the existence
of the FreeBSD qsort_r(3) interface in 2004 and refused to add the
same interface to glibc based on grounds of the lack of standardization
and portability concerns, has decided it was a good idea to introduce
their own qsort_r(3) interface in 2007 as a GNU extension with a
slightly different and incompatible interface.

With the adoption of their interface as POSIX standard, let's switch
to the same prototype, there is no need to remain incompatible.

C++ and C applications written for the historical FreeBSD interface
get source level compatibility when building in C++ mode, or when
building with a C compiler with C11 generics support, provided that
the caller passes a fifth parameter of qsort_r() that exactly matches
the historical FreeBSD comparator function pointer type and does not
redefine the historical qsort_r(3) prototype in their source code.

Symbol versioning is used to keep old binaries working.

MFC:			never
Relnotes:		yes
Reviewed by:		cem, imp, hps, pauamma
Differential revision:	https://reviews.freebsd.org/D17083
</content>
</entry>
<entry>
<title>libc: add clearenv function</title>
<updated>2021-11-07T15:20:15Z</updated>
<author>
<name>Mariusz Zaborski</name>
<email>oshogbo@FreeBSD.org</email>
</author>
<published>2021-11-07T15:15:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=597b02675751e48dd04777f1e91fee382bf3a966'/>
<id>urn:sha1:597b02675751e48dd04777f1e91fee382bf3a966</id>
<content type='text'>
The clearenv(3) function allows us to clear all environment
variable in one shot. This may be useful for security programs that
want to control the environment or what variables are passed to new
spawned programs.

Reviewed by:	scf, markj (secteam), 0mp (manpages)
Differential Revision:	https://reviews.freebsd.org/D28223
</content>
</entry>
<entry>
<title>libc qsort(3): Eliminate ambiguous sign comparison</title>
<updated>2021-07-29T03:59:20Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2021-07-23T18:04:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7f8f79a5c444a565a32b0c6578b07f8d496f6c49'/>
<id>urn:sha1:7f8f79a5c444a565a32b0c6578b07f8d496f6c49</id>
<content type='text'>
The left side of the MIN() expression is the (signed) result of pointer
subtraction (ptrdiff_t).  The right hand side is the also the (signed)
result of pointer subtraction, additionally subtracting the element size
('es'), which is unsigned size_t.  This coerces the right-hand
expression into an unsigned value.  MIN(signed, unsigned) triggers
-Wsign-compare.

Sorting elements of size greater than SSIZE_MAX is nonsensical, so we
can instead treat the element size as ssize_t, leaving the right-hand
result the same signedness as the left.

Reviewed by:		arichardson, kib
Differential Revision:	https://reviews.freebsd.org/D31292
</content>
</entry>
<entry>
<title>Implement ptsname_r.</title>
<updated>2020-10-17T04:14:38Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2020-10-17T04:14:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3e7224dffe26948af09082309bbb6a6803e12049'/>
<id>urn:sha1:3e7224dffe26948af09082309bbb6a6803e12049</id>
<content type='text'>
MFC after:	2 weeks
PR:		250062
Reviewed by:	jilles, 0mp, Ray &lt;i maskray me&gt;
Differential Revision:	https://reviews.freebsd.org/D26647
</content>
</entry>
</feed>
