Date: Fri, 28 Jun 2002 11:10:04 -0700 (PDT) From: gson@nominum.com (Andreas Gustafsson) To: freebsd-bugs@FreeBSD.org Subject: Re: kern/38527: /dev/random does not obey O_NONBLOCK flag Message-ID: <200206281810.g5SIA4d0089704@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/38527; it has been noted by GNATS.
From: gson@nominum.com (Andreas Gustafsson)
To: Nate Lawson <nate@root.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/38527: /dev/random does not obey O_NONBLOCK flag
Date: Fri, 28 Jun 2002 11:02:45 -0700 (PDT)
Nate Lawson writes:
> This behavior is intentional and was changed some time ago. If you want
> to block on /dev/random waiting for bytes to be available, use
> select/poll.
You've got to be kidding. Why would you intentionally implement a
behaviour that is
a) gratuitously different from every other implementation of
/dev/random
b) gratuitously different from every other character
device in the history of Unix by being nonblocking
by default,
c) not even correctly nonblocking, because when no data
is available, read() on a nonblocking device is supposed
to return -1 with errno=EWOULDBLOCK, but in the case
of /dev/random, read() returns 0,
and
d) undocumented?
--
Andreas Gustafsson, gson@nominum.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206281810.g5SIA4d0089704>
