From owner-freebsd-bugs Fri Jun 28 11:10:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2A2E37B400 for ; Fri, 28 Jun 2002 11:10:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6327D43E06 for ; Fri, 28 Jun 2002 11:10:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5SIA4JU089705 for ; Fri, 28 Jun 2002 11:10:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5SIA4d0089704; Fri, 28 Jun 2002 11:10:04 -0700 (PDT) Date: Fri, 28 Jun 2002 11:10:04 -0700 (PDT) Message-Id: <200206281810.g5SIA4d0089704@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: gson@nominum.com (Andreas Gustafsson) Subject: Re: kern/38527: /dev/random does not obey O_NONBLOCK flag Reply-To: gson@nominum.com (Andreas Gustafsson) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/38527; it has been noted by GNATS. From: gson@nominum.com (Andreas Gustafsson) To: Nate Lawson 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