[PATCH] libc++: add NaCl and PNaCl support for std::random_device

JF Bastien jfb at chromium.org
Thu Nov 27 13:21:01 PST 2014


Hi dschuff, mclow.lists, danalbert,

The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.

This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).

http://reviews.llvm.org/D6442

Files:
  include/random
  src/random.cpp
  test/numerics/rand/rand.device/ctor.pass.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6442.16707.patch
Type: text/x-patch
Size: 5330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141127/6b80274d/attachment.bin>


More information about the cfe-commits mailing list