lxip: fake get_random_bytes()

This commit is contained in:
Christian Helmuth 2013-11-27 16:19:18 +01:00 committed by Norman Feske
parent c05a80a139
commit 1ba4e033a7
4 changed files with 16 additions and 4 deletions

View File

@ -43,8 +43,6 @@ enum {
** Plugin interface **
**********************/
extern "C" void wait_for_continue();
namespace {
class Plugin_context : public Libc::Plugin_context

View File

@ -229,7 +229,6 @@ DUMMY(-1, getnstimeofday)
DUMMY(-1, get_nulls_value)
DUMMY(-1, get_options)
DUMMY(-1, get_page)
DUMMY(-1, get_random_bytes)
DUMMY(-1, gfp_pfmemalloc_allowed)
DUMMY(-1, gid_lte)
DUMMY(-1, hash32_ptr)

View File

@ -2602,6 +2602,21 @@ static inline bool ipv4_is_loopback(__be32 addr)
#include <uapi/linux/in6.h>
/********************
** linux/random.h **
********************/
static inline void get_random_bytes(void *buf, int nbytes)
{
char *b = (char *)buf;
/* FIXME not random */
int i;
for (i = 0; i < nbytes; ++i)
b[i] = i + 1;
}
/**
* Misc
*/

View File

@ -392,7 +392,7 @@ class Net::Socketcall : public Genode::Signal_dispatcher_base,
while (true) {
Genode::Signal s = Net::Env::receiver()->wait_for_signal();
static_cast<Genode::Signal_dispatcher_base *>(s.context())->dispatch(s.num());
}
}
}
/***********************