]> git.ipfire.org Git - thirdparty/libbsd.git/commit
Add recallocarray() and freezero() from OpenBSD
authorFaidon Liambotis <paravoid@debian.org>
Thu, 31 Dec 2020 10:46:03 +0000 (12:46 +0200)
committerGuillem Jover <guillem@hadrons.org>
Fri, 1 Jan 2021 17:18:51 +0000 (18:18 +0100)
commit01f0d1ea1e71f1018a009ebd9203dd48e6d90c45
treea1dbb9416cea7186a8a5e6ee8c950c4f4683a94d
parent9c85d828a1abdd698f8a587abe8cbbaaa80eade8
Add recallocarray() and freezero() from OpenBSD

Add recallocarray(), introduced in OpenBSD 6.1, and freezero(),
introduced in OpenBSD 6.2. The former is imported as-is from OpenBSD,
while the latter is the non-malloc-internal branch of the same code (and
also the OpenSSH portable variant).

Both of these originated in OpenBSD, but have also been implemented by
IllumOS, cf. https://www.illumos.org/issues/8546

Documentation for these functions is in malloc(3) upstream, the relevant
parts of which were previously imported in reallocarray(3bsd). Update
reallocarray(3bsd) with the changes that were introduced since, and add
the relevant bits for recallocarray() and freezero(), plus aliases.

[guillem@hadrons.org: Update copyright in COPYING. ]

Closes: !10
Signed-off-by: Guillem Jover <guillem@hadrons.org>
COPYING
include/bsd/stdlib.h
man/Makefile.am
man/freezero.3bsd [new file with mode: 0644]
man/reallocarray.3bsd
man/recallocarray.3bsd [new file with mode: 0644]
src/Makefile.am
src/freezero.c [new file with mode: 0644]
src/libbsd.map
src/recallocarray.c [new file with mode: 0644]