mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-06-05 00:22:46 +08:00
random: Implement read_random via getentropy.
This commit is contained in:
parent
9efc6500fb
commit
9ea8664ba2
@ -50,11 +50,21 @@ read_random_uio(void *a __unused, u_int b __unused)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
#ifndef __rtems__
|
||||
static __inline u_int
|
||||
read_random(void *a __unused, u_int b __unused)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
#else /* __rtems__ */
|
||||
#include <unistd.h>
|
||||
static __inline u_int
|
||||
read_random(void *ptr, u_int n)
|
||||
{
|
||||
getentropy(ptr, n);
|
||||
return (n);
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user