Date: Mon, 19 Jan 1998 17:36:39 -0500 From: "Alfred Perlstein" <perlsta@sunyit.edu> To: "John Birrell" <jb@freebsd1.cimlogic.com.au>, "Jacques Fourie" <jacques@oskar.nanoteq.co.za> Cc: <freebsd-hackers@FreeBSD.ORG> Subject: Re: Unable to open /dev/urandom when compiling with -lc_r Message-ID: <199801191840.SAA18894@fang.cs.sunyit.edu>
next in thread | raw e-mail | index | archive | help
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 <jb@freebsd1.cimlogic.com.au> > To: Jacques Fourie <jacques@oskar.nanoteq.co.za> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801191840.SAA18894>