[lkml]   [2000]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: /dev/random probs in 2.4test(12-pre3)
Followup to:  <>
By author: Matthew Kirkwood <>
In newsgroup:
> Hi,
> It looks like the random driver in 2.4test will return a
> short read, rather than blocking. This is breaking vpnd
> ( which breaks with "failed to
> gather random data" or similar.
> Here's a sample strace:
> open("/dev/random", O_RDONLY) = 3
> read(3, "q\321Nu\204\251^\234i\254\350\370\363\"\305\366R\2708V"..., 72) = 29
> close(3) = 0
> Have the semantics of the device changed, or is vpnd doing
> something wrong?

vpnd is doing something wrong: it's assuming short reads won't
happen. /dev/random will block if there is NOTHING to be read;
however, if there are bytes to be read, it will return them even if it
is less than the user asked for.

<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot."
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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