From owner-freebsd-hackers Thu Feb 6 14:09:21 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA09598 for hackers-outgoing; Thu, 6 Feb 1997 14:09:21 -0800 (PST) Received: from seabass.progroup.com (catfish.progroup.com [206.24.122.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA09593 for ; Thu, 6 Feb 1997 14:09:15 -0800 (PST) Received: from seabass.progroup.com (seabass.progroup.com [206.24.122.1]) by seabass.progroup.com (8.7.5/8.7.3) with SMTP id OAA11528; Thu, 6 Feb 1997 14:08:21 -0800 (PST) Message-ID: <32FA5655.3F54BC7E@progroup.com> Date: Thu, 06 Feb 1997 14:08:21 -0800 From: Craig Shaver Organization: Productivity Group, Inc. X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 2.1.5-RELEASE i386) MIME-Version: 1.0 To: hackers@FreeBSD.org Subject: Re: fcntl, F_SETFL, O_NONBLOCK & /dev/null References: <199702060238.NAA04044@freebsd1.cimlogic.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk John Birrell wrote: > > Bruce Evans wrote: > > >I can open /dev/null with O_NONBLOCK. If I open /dev/null without > > >O_NONBLOCK and then try to fcntl F_SETFL to change the file descriptor > > >to non-blocking, I get ENODEV returned. Can someone tell me why? > > > > fcntl(fd, F_SETFL, O_NONBLOCK) is translated to an FIONBIO ioctl, and > > the device driver for /dev/null doesn't support this ioctl. None of > > the memory devices support it. del ... > Thanks for the info. This means that libc_r will always have difficulty > dealing with such devices. The library expects to be given non-blocking > behaviour if (when) it asks for it. So the best I can do is open() > the device with O_NONBLOCK and hope that the driver obeys. If not, an > unexpected wait will occur, without another thread being scheduled in > the meantime. Hmmm, yet another reason for kernel threads... > > > > > Bruce > > > > -- Is there any work being done for implementing kernel threads? I would think this would be very important for a robust, real-world usable, thread package. -- Craig Shaver (craig@progroup.com) (415)390-0654 Productivity Group POB 60458 Sunnyvale, CA 94088