lkml.org 
[lkml]   [2000]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: /dev/random probs in 2.4test(12-pre3)
Date
Followup to:  <Pine.LNX.4.21.0012021955570.11787-100000@server.serve.me.nl>
By author: Igmar Palsenberg <maillist@chello.nl>
In newsgroup: linux.dev.kernel
>
> > 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.
>

That's pretty much ALWAYS wrong -- for pipes, sockets, you name it. A
blocking read() will only block if there is nothing to read at all.

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.056 / U:4.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site