Skip to content

Commit 992c8dd

Browse files
xiaoxiang781216raiden00pl
authored andcommitted
libc: Fix lib_arc4random.c:111:(.text.arc4random_buf+0x26): undefined reference to `clock_systime_ticks'
by replacing clock_systime_ticks to clock Signed-off-by: Xiang Xiao <[email protected]>
1 parent c08e1ba commit 992c8dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/libc/stdlib/lib_arc4random.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#include <string.h>
3131
#include <sys/param.h>
3232
#include <sys/random.h>
33+
#include <time.h>
3334

34-
#include <nuttx/clock.h>
3535
#include <nuttx/hashtable.h>
3636

3737
/****************************************************************************
@@ -108,7 +108,7 @@ void arc4random_buf(FAR void *bytes, size_t nbytes)
108108

109109
while (nbytes > 0)
110110
{
111-
uint32_t hash = HASH(clock_systime_ticks() - nbytes, 32);
111+
uint32_t hash = HASH(clock() - nbytes, 32);
112112
size_t ncopy = MIN(nbytes, sizeof(hash));
113113

114114
memcpy(bytes, &hash, ncopy);

0 commit comments

Comments
 (0)