[libcxx-commits] [PATCH] D94571: [libcxx] random_device, for OpenBSD specify optimal entropy properties
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 13 07:21:36 PST 2021
ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
================
Comment at: libcxx/src/random.cpp:37
+#ifdef __OpenBSD__
+#include <limits>
+#endif
----------------
You can include this unconditionally. Please include it alongside `"random"` and `"system_error"` above.
================
Comment at: libcxx/src/random.cpp:179
+#ifdef __OpenBSD__
+ return std::numeric_limits<unsigned int>::digits;
+#else
----------------
Couldn't we do a better job and use `ioctl` on Linuxes? See cppreference: https://en.cppreference.com/w/cpp/numeric/random/random_device/entropy
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94571/new/
https://reviews.llvm.org/D94571
More information about the libcxx-commits
mailing list