libc: add support for FreeBSDs KERN_ARND sysctl

Provide FreeBSDs KERN_ARND systemctl by calling getentropy().

To use it, configure an RNG via the `rng` libc runtime parameter.

Ref #4997
This commit is contained in:
Benjamin Lamowski 2023-09-13 23:27:59 +02:00 committed by Christian Helmuth
parent aa5751b7fc
commit 37a6669e71

View File

@ -1,11 +1,12 @@
/*
* \brief Sysctl facade
* \author Emery Hemingway
* \author Benjamin Lamowski
* \date 2016-04-27
*/
/*
* Copyright (C) 2016-2019 Genode Labs GmbH
* Copyright (C) 2016-2023 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@ -84,6 +85,10 @@ extern "C" int __sysctl(const int *name, u_int namelen,
/* builtins */
{
switch(index_a) {
case CTL_KERN: switch(index_b) {
case KERN_ARND:
return getentropy(oldp, *oldlenp);
}
case CTL_HW: switch(index_b) {
case HW_REALMEM: