diff --git a/repos/dde_linux/src/lib/lx_emul/random_dummy.cc b/repos/dde_linux/src/lib/lx_emul/random_dummy.cc new file mode 100644 index 0000000000..f1106d4875 --- /dev/null +++ b/repos/dde_linux/src/lib/lx_emul/random_dummy.cc @@ -0,0 +1,50 @@ +/* + * \brief Dummy source of randomness in lx_emul + * \author Josef Soentgen + * \date 2023-06-13 + */ + +/* + * Copyright (C) 2023 Genode Labs GmbH + * + * This file is distributed under the terms of the GNU General Public License + * version 2. + */ + +/* base/include */ +#include +#include +#include + +/* dde_linux/src/include */ +#include + + +using namespace Genode; + +void lx_emul_random_gen_bytes(void *dst, + unsigned long nr_of_bytes) +{ + /* validate arguments */ + if (dst == nullptr || nr_of_bytes == 0) { + error(__func__, " called with invalid args!"); + return; + } + + warning(__func__, ": dummy implementation used, filling buffer with 0s"); + memset(dst, 0, nr_of_bytes); +} + + +genode_uint32_t lx_emul_random_gen_u32() +{ + warning(__func__, ": dummy implementation used, returning 0"); + return 0; +} + + +genode_uint64_t lx_emul_random_gen_u64() +{ + warning(__func__, ": dummy implementation used, returning 0"); + return 0; +}