[Toybox] [PATCH] xgetrandom: fix macOS build.

enh enh at google.com
Sun Jun 19 10:37:58 PDT 2022


BSD has <sys/random.h> first, but has getentropy() in there. glibc
has getentropy() in addition to getrandom(), but they keep it in
<unistd.h> instead. Since both went in in glibc 2.25 I don't think
this will matter in practice, but if this does cause trouble, we
can have separate getentropy() and getrandom() implementations for
the BSDs versus glibc.

This does mean that the only valid values for `flags` are now 0 or
WARN_ONLY, but that was already effectively true anyway because
GRND_NONBLOCK != O_NONBLOCK so the fallback path was already broken.
---
 lib/portability.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220619/d95a4072/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xgetrandom-fix-macOS-build.patch
Type: application/octet-stream
Size: 1707 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220619/d95a4072/attachment.obj>


More information about the Toybox mailing list