[PATCH] D40319: [libcxx] Support getentropy as a source of randomness for std::random_device

Jonathan Wakely via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 25 07:02:28 PST 2021


jwakely added inline comments.
Herald added a subscriber: abrachet.


================
Comment at: libcxx/trunk/src/random.cpp:29
+#if defined(_LIBCPP_USING_GETENTROPY)
+#include <sys/random.h>
+#elif defined(_LIBCPP_USING_DEV_RANDOM)
----------------
musl only declares `getentropy` in `<unistd.h>` not `<sys/random.h>`. Glibc declares it in both. Should `<unistd.h>` also be included when `_LIBCPP_USING_GETENTROPY` is defined, so it can work more portably?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D40319/new/

https://reviews.llvm.org/D40319



More information about the cfe-commits mailing list