Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Feb 1997 14:08:21 -0800
From:      Craig Shaver <craig@progroup.com>
To:        hackers@FreeBSD.org
Subject:   Re: fcntl, F_SETFL, O_NONBLOCK & /dev/null
Message-ID:  <32FA5655.3F54BC7E@progroup.com>
References:  <199702060238.NAA04044@freebsd1.cimlogic.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32FA5655.3F54BC7E>