Skip to content

Commit

Permalink
Merge pull request rust-random#134 from tomprince/nonblocking-note
Browse files Browse the repository at this point in the history
Add a note about `OsRng` blocking in early init.
  • Loading branch information
alexcrichton authored Feb 27, 2017
2 parents fc988b1 + 60324e7 commit eaf76b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ use Rng;
/// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed.
/// - PNaCl: calls into the `nacl-irt-random-0.1` IRT interface.
///
/// This does not block.
/// This usually does not block. On some systems (e.g. FreeBSD, OpenBSD,
/// Max OS X, and modern Linux) this may block very early in the init
/// process, if the CSPRNG has not been seeded yet.[1]
///
/// [1] See https://www.python.org/dev/peps/pep-0524/ for a more in-depth
/// discussion.
pub struct OsRng(imp::OsRng);

impl OsRng {
Expand Down

0 comments on commit eaf76b4

Please sign in to comment.