[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35
From: |
Fabrice Fontaine |
Subject: |
[PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35 |
Date: |
Tue, 30 Nov 2021 18:29:48 +0100 |
Fix the following build failure with uclibc < 1.0.35 which is raised
since the addition of getrandom module in
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=682cc4e678aceff32dea2a84b6e5147bdf5a20a7:
In file included from ./sys/random.h:40,
from getrandom.c:22:
/home/fabrice/buildroot/output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35:
error: unknown type name 'size_t'
27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
| ^~~~~~
/home/fabrice/buildroot/output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1:
note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include
<stddef.h>'?
7 | #include <features.h>
+++ |+#include <stddef.h>
8 |
This patch is a workaround for uclibc < 1.0.35, upstream uclibc has been
patched with
https://github.com/wbx-github/uclibc-ng/commit/00972c02c2b6e0a95d5def4a71bdfb188e091782
Fixes:
-
http://autobuild.buildroot.org/results/adecc3e5def140348dfff30961fe6514c9a8e7b5
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
lib/getrandom.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/getrandom.c b/lib/getrandom.c
index 41212fb32..0ad3f9648 100644
--- a/lib/getrandom.c
+++ b/lib/getrandom.c
@@ -19,6 +19,7 @@
#include <config.h>
+#include <stddef.h>
#include <sys/random.h>
#include <errno.h>
--
2.30.2
- [PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35,
Fabrice Fontaine <=