Date: Mon, 1 Aug 2005 16:33:23 +0300 From: victor cruceru <victor.cruceru@gmail.com> To: Marc Olzheim <marcolz@stack.nl> Cc: freebsd-hackers@freebsd.org Subject: Re: O_NONBLOCK for devices with removable media Message-ID: <494025505080106336a329bb@mail.gmail.com> In-Reply-To: <20050801130502.GA39470@stack.nl> References: <494025505080104427c3f91f6@mail.gmail.com> <20050801130502.GA39470@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Marc, Thanks for the info. Here it is one my situation. I have a CF reader (fully= =20 detected by the USB subsystem) with two slots (one with a media and one without any media). An open with O_NONBLOCK on th= e=20 empty slot (/dev/da1) is blocking me. Is this OK?=20 Thanks, Victor=20 On 8/1/05, Marc Olzheim <marcolz@stack.nl> wrote: >=20 > On Mon, Aug 01, 2005 at 02:42:21PM +0300, victor cruceru wrote: > > Hi all, > > I'm just wondering if it's OK for an open syscall on such a device (i.e= . > > /dev/acd0 or /dev/da1 with a CF reader attached) to block till the medi= a=20 > is > > ready or a timeout occurs. >=20 > I'd say that depends completely on whether you supply O_NONBLOCK or not, > so yes. >=20 > Quoted from a sound driver discussion at: > http://sourceforge.net/mailarchive/message.php?msg_id=3D10011826 >=20 >=20 > On block devices, O_NONBLOCK also is a way to say "don't try to do any > device discovery", ie you can do a O_NONBLOCK open on a removable disk > that doesn"t even have any media in it. Again, this has _nothing_ to do > with whether the device is "busy" or not. >=20 > ... >=20 > Short summary: >=20 > - O_NONBLOCK should generally be seen as just setting the O_NONBLOCK flag > "early" (ie it"s conceptually equivalent to doing a "F_SETFL" fcntl > before the open. It _may_ affect the open itself, but when it does, it > is generally considered to mean that you can open something that isn't > even _reachable_. >=20 > - POSIX doesn't say anything much about its behaviour, except for named > pipes, where it says the total reverse of what ALSA does. But that > doesn't actually mean anything, because even that is very much defined > as a special case by POSIX. >=20 > Marc >=20 >=20 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?494025505080106336a329bb>