From owner-freebsd-arch@FreeBSD.ORG Fri Apr 1 15:19:03 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A91A106566C; Fri, 1 Apr 2011 15:19:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8E8608FC13; Fri, 1 Apr 2011 15:19:02 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA27456; Fri, 01 Apr 2011 18:18:55 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4D95ECDE.1020504@FreeBSD.org> Date: Fri, 01 Apr 2011 18:18:54 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Andrew Duane References: <4D95E162.40605@FreeBSD.org>, In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers , FreeBSD Arch Subject: Re: looking for error codes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2011 15:19:03 -0000 on 01/04/2011 18:04 Andrew Duane said the following: > AFAIK, FreeBSD does not really detect read-only media. This was something I had to add as a small project here at work, and was considering cleaning up to try to get into CURRENT. If there's a real need for it, I could speed that up. > Yes, that's exactly the problem that I am looking at. So if you have anything to share it will be greatly appreciated at least by me. But I think many more people could benefit from it (e.g. those having SD/SDHC/etc cards). Thanks! > ________________________________________ > From: owner-freebsd-hackers@freebsd.org [owner-freebsd-hackers@freebsd.org] On Behalf Of Warner Losh [imp@bsdimp.com] > Sent: Friday, April 01, 2011 10:51 AM > To: Andriy Gapon > Cc: FreeBSD Hackers; FreeBSD Arch > Subject: Re: looking for error codes > > On Apr 1, 2011, at 8:29 AM, Andriy Gapon wrote: > >> >> I am looking for error codes that would unambiguously signal that a disk drive has >> readonly or write-protected media and that disk drive has no media at the moment. >> I foresee these error codes being used mostly between disk peripheral drivers and >> filesystem drivers. >> >> I will appreciate your suggestions. >> >> P.S. >> I see that Linux uses EROFS and ENOMEDIUM for these purposes. >> I am not sure about EROFS in this role. >> And we don't have ENOMEDIUM (nor EMEDIUMTYPE). > > Maybe we could add ENOMEDIA for that (spelled however Linux spells it) after EDAVE. -- Andriy Gapon