Re: /dev/random probs in 2.4test(12-pre3)

From: Jeff Garzik (jgarzik@mandrakesoft.mandrakesoft.com)
Date: Sat Dec 02 2000 - 13:03:56 EST


On Sat, 2 Dec 2000, Igmar Palsenberg wrote:
> > Indeed, you are correct. Is vpnd broken then, for assuming
> > that it can gather the required randomness in one read?
>
> Yep. It assumes that if the required randommness numbers aren't met a read
> to /dev/random will block.
>
> And it's not the only program that assumes this : I also did.
>
> /dev/random is called a blocking random device, which more or less implies
> that it will totally block. I suggest we put this somewhere in the kernel
> docs, since lots of people out there assume that it totally blocks.

"totally block"?

For a blocking fd, read(2) has always blocked until some data is
available. There has never been a guarantee, for any driver, that
a read(2) will return the full amount of bytes requested.

There is no need to document this... man read(2) ;-)

        Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 21:00:09 EST