Skip to content

Commit

Permalink
[libcxx] random_device, use arc4random() on Solaris
Browse files Browse the repository at this point in the history
Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D125068
  • Loading branch information
brad0 committed May 7, 2022
1 parent 1dda6ad commit ed85de6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libcxx/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ ABI Changes
``_LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION`` will not be honoured anymore and there
will be no way to opt back into the C++03 emulation of ``std::nullptr_t``.

- On FreeBSD, NetBSD and DragonFlyBSD, ``std::random_device`` is now implemented on top of
``arc4random()`` instead of reading from ``/dev/urandom``. Any implementation-defined
- On FreeBSD, NetBSD, DragonFlyBSD and Solaris, ``std::random_device`` is now implemented on
top of ``arc4random()`` instead of reading from ``/dev/urandom``. Any implementation-defined
token used when constructing a ``std::random_device`` will now be ignored instead of
interpreted as a file to read entropy from.

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
// When this option is used, the token passed to `std::random_device`'s
// constructor *must* be "/dev/urandom" -- anything else is an error.
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__OpenBSD__) || defined(__DragonFly__)
defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
# define _LIBCPP_USING_ARC4_RANDOM
#elif defined(__wasi__)
# define _LIBCPP_USING_GETENTROPY
Expand Down

0 comments on commit ed85de6

Please sign in to comment.