Skip to content

Commit

Permalink
libc: Fix lib_arc4random.c:111:(.text.arc4random_buf+0x26): undefined…
Browse files Browse the repository at this point in the history
… reference to `clock_systime_ticks'

by replacing clock_systime_ticks to clock

Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 authored and raiden00pl committed Oct 28, 2024
1 parent c08e1ba commit 992c8dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/libc/stdlib/lib_arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <string.h>
#include <sys/param.h>
#include <sys/random.h>
#include <time.h>

#include <nuttx/clock.h>
#include <nuttx/hashtable.h>

/****************************************************************************
Expand Down Expand Up @@ -108,7 +108,7 @@ void arc4random_buf(FAR void *bytes, size_t nbytes)

while (nbytes > 0)
{
uint32_t hash = HASH(clock_systime_ticks() - nbytes, 32);
uint32_t hash = HASH(clock() - nbytes, 32);
size_t ncopy = MIN(nbytes, sizeof(hash));

memcpy(bytes, &hash, ncopy);
Expand Down

0 comments on commit 992c8dd

Please sign in to comment.