[PATCH] m68k: fix getrandom() use with uclibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  b9de05184816 ("m68k: pass rng seed via BI_RNG_SEED")
Cc: Jason@xxxxxxxxx
Signed-off-by: Laurent Vivier <laurent@xxxxxxxxx>
---
 kexec/arch/m68k/bootinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 086a34bdfdeb..5afd212d9d34 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>
-- 
2.40.0


_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux