From owner-freebsd-scsi Thu Aug 22 19:35:47 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B10B537B400; Thu, 22 Aug 2002 19:35:44 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB0A743E65; Thu, 22 Aug 2002 19:35:41 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id CAA28886; Fri, 23 Aug 2002 02:35:26 GMT Date: Fri, 23 Aug 2002 12:41:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "M. Warner Losh" Cc: ken@kdm.org, , , , , , Subject: Re: kern/15608: acd0 / cd0 give inconsistent errors on empty tray open() In-Reply-To: <20020822.152329.129782316.imp@bsdimp.com> Message-ID: <20020823122010.S6402-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 22 Aug 2002, M. Warner Losh wrote: > In message: <20020822150931.A10866@panzer.kdm.org> > "Kenneth D. Merry" writes: > : So is there any opinion on -standards as to what sort of error we should > : return on open if there is no media in a drive? > > EIO means "The device is there, but the driver had problems > interacting with it" while ENXIO means "the device isn't there at > all." As such, EIO is the more correct error to return in this case. No, EIO means that an input/output arror occurred. open.2 only documents EIO for creating files. Otherwise open() normally doesn't do any i/o. So ENXIO is the more correct error. I think the bug is that the open doesn't succeed. The device is reported as being there at boot time, and there is enough of it there to tell which parts of it aren't there, so why not open() it so that you do things like ioctl() on it to close its door and make it there? > I don't know if the standards speak to this specific issue (no or bad > media in a device with removable media). POSIX doesn't say anything much different from open.2 about this. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message