Skip to main content

GRND_NONBLOCK

Constant GRND_NONBLOCK 

Source
pub const GRND_NONBLOCK: u32 = 1;
Expand description

Fill a buffer with random bytes from the kernel entropy pool.

§Arguments

  • buf - Mutable byte buffer to fill
  • flags - GRND_NONBLOCK (1) to return EAGAIN if pool not ready, GRND_RANDOM (2) for /dev/random quality (same pool)

§Returns

  • Number of bytes written on success
  • Err(Error::Again) if GRND_NONBLOCK and entropy not yet ready