[libcxx-commits] [PATCH] D94953: [libc++] Use ioctl when available to get random_device entropy.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 19 07:22:03 PST 2021


ldionne requested changes to this revision.
ldionne added a subscriber: tcanens.
ldionne added a comment.
This revision now requires changes to proceed.

@tcanens  You may want to consider updating cppreference in light of this patch when it gets in.

This LGTM except for the test nitpick!



================
Comment at: libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp:25-26
+  double e = r.entropy();
+  assert(e >= 0);
+  assert(e <= 32);
 
----------------
I think we want to make those be `LIBCPP_ASSERT(...)` instead, since the entropy is technically not mandated by the standard. It's just that our implementation behaves that way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94953



More information about the libcxx-commits mailing list