[lkml]   [2000]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: /dev/random probs in 2.4test(12-pre3)
Igmar Palsenberg wrote:

> > 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.
> I know. Still leaves lot's of people that assume that reading /dev/random
> will return data, or will block.
> I've seen lots of programs that will assume that if we request x bytes
> from /dev/random it will return x bytes.

I find this really humorous honestly. I see a lot of people assuming that if
you write N bytes or read N bytes that you will have done N bytes. There are
return values for these functions that tell you clearly how many bytes were

Any programmer who has evolved sufficiently from a scriptie should take
necessary precautions to check how much data was transferred. Those who
don't..well, there is still tomorrow.

There is no reason to add any additional documentation. If we did, we'd be
starting the trend of documenting the direction a mouse moves when it's
pushed and not to be alarmed if you turn the mouse sideways and the result is
90 degrees off.


title:Blue Labs Developer
note;quoted-printable:GPG key:
fn:David Ford
 \ /
  Last update: 2005-03-22 12:51    [W:0.074 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site