mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-31 22:50:54 +00:00
lxip: get_random_once must be called once
This commit is contained in:
parent
d647b6c797
commit
ca3be471a9
@ -3188,10 +3188,14 @@ static inline bool ipv4_is_loopback(__be32 addr)
|
|||||||
|
|
||||||
void get_random_bytes(void *buf, int nbytes);
|
void get_random_bytes(void *buf, int nbytes);
|
||||||
|
|
||||||
static inline void get_random_once(void *buf, int nbytes)
|
#define get_random_once(buf, nbytes) \
|
||||||
{
|
({ \
|
||||||
return get_random_bytes(buf, nbytes);
|
static bool initialized = false; \
|
||||||
}
|
if (!initialized) { \
|
||||||
|
get_random_bytes((buf), (nbytes)); \
|
||||||
|
initialized = true; \
|
||||||
|
} \
|
||||||
|
})
|
||||||
|
|
||||||
u32 prandom_u32(void);
|
u32 prandom_u32(void);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user