| //===-------------------------- random.cpp --------------------------------===// |
| // The LLVM Compiler Infrastructure |
| // This file is dual licensed under the MIT and the University of Illinois Open |
| // Source Licenses. See LICENSE.TXT for details. |
| //===----------------------------------------------------------------------===// |
| _LIBCPP_BEGIN_NAMESPACE_STD |
| random_device::random_device(const string& __token) |
| : __f_(open(__token.c_str(), O_RDONLY)) |
| __throw_system_error(errno, ("random_device failed to open " + __token).c_str()); |
| random_device::~random_device() |
| random_device::operator()() |
| read(__f_, &r, sizeof(r)); |
| random_device::entropy() const |
| _LIBCPP_END_NAMESPACE_STD |