From owner-freebsd-hackers Mon Jan 19 14:40:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA28988 for hackers-outgoing; Mon, 19 Jan 1998 14:40:41 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fang.cs.sunyit.edu (root@fang.cs.sunyit.edu [192.52.220.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA28864 for ; Mon, 19 Jan 1998 14:39:49 -0800 (PST) (envelope-from perlsta@sunyit.edu) Received: from win95.local.sunyit.edu (A-T34.rh.sunyit.edu [150.156.210.241]) by fang.cs.sunyit.edu (8.8.5/8.7.3) with ESMTP id SAA18894; Mon, 19 Jan 1998 18:40:44 GMT Message-Id: <199801191840.SAA18894@fang.cs.sunyit.edu> From: "Alfred Perlstein" To: "John Birrell" , "Jacques Fourie" Cc: Subject: Re: Unable to open /dev/urandom when compiling with -lc_r Date: Mon, 19 Jan 1998 17:36:39 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk quick thought, why not do something like this: p = pipe() if(fork()==0) pass 'p' to both processes one process reads from /dev/urandom, the other reads off the pipe non-blocking? -Alfred ---------- > From: John Birrell > To: Jacques Fourie > Cc: freebsd-hackers@FreeBSD.ORG > Subject: Re: Unable to open /dev/urandom when compiling with -lc_r > Date: Monday, January 19, 1998 2:40 PM > > Jacques Fourie wrote: > > I am unable to open /dev/urandom when compiling with -lc_r. The open() call > > returns -1, with errno set to 25 (ENOTTY). > > The device driver does not support non-blocking accesses. It is reporting > "Inappropriate ioctl for device". libc_r needs to make all file descriptors > non-blocking so that it can switch threads in user-space without being held > up in the kernel. Not all device drivers support this, though. > > The move to kernel threads solves this problem once and for all, but > that doesn't help you now. > > Regards, > > -- > John Birrell - jb@cimlogic.com.au; jb@netbsd.org; jb@freebsd.org > CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137