Skip to content

Commit

Permalink
m68k: fix getrandom() use with uclibc
Browse files Browse the repository at this point in the history
With uclibc, getrandom() is only defined with _GNU_SOURCE, fix that:

kexec/arch/m68k/bootinfo.c: In function 'bootinfo_add_rng_seed':
kexec/arch/m68k/bootinfo.c:231:13: warning: implicit declaration of function 'getrandom'; did you mean 'srandom'? [-Wimplicit-function-declaration]
  231 |         if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
      |             ^~~~~~~~~
      |             srandom
kexec/arch/m68k/bootinfo.c:231:56: error: 'GRND_NONBLOCK' undeclared (first use in this function)
  231 |         if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
      |                                                        ^~~~~~~~~~~~~

Fixes:  b9de051 ("m68k: pass rng seed via BI_RNG_SEED")
Cc: Jason@zx2c4.com
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Simon Horman <horms@kernel.org>
  • Loading branch information
vivier authored and horms committed Nov 27, 2023
1 parent 3472c2b commit 769ae43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kexec/arch/m68k/bootinfo.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _GNU_SOURCE

#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit 769ae43

Please sign in to comment.