tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Linux /dev/random O_NONBLOCK read() (was: NetBSD openjdk SecureRandom /dev/random "Resource temporarily unavailable" issue)



> from linux RANDOM(4):
> 
> If open(2) is called for /dev/random with the flag O_NONBLOCK, a
> subsequent read(2) will not block if the requested number of bytes
> is not available. Instead, the available bytes are returned.
What? In my impression, it's standard behaviour of read(2) since at least V7 
to return only the available data, even if that's less than what was requested.

I know Fefe has just been ranting about Linux (and BSDs) to only return 2G 
upon a 4G read(2) from a 4G file, but I'd say that's hust how read(2) works.


Home | Main Index | Thread Index | Old Index