From owner-freebsd-hackers Sat Feb 10 5:56:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.sanda.gr.jp (ns.sanda.gr.jp [210.232.122.18]) by hub.freebsd.org (Postfix) with ESMTP id 4C5B037B401 for ; Sat, 10 Feb 2001 05:56:07 -0800 (PST) Received: from ever.sanda.gr.jp (epoch [10.93.63.51]) by ns.sanda.gr.jp (8.9.3/3.7W) with ESMTP id WAA24323 for ; Sat, 10 Feb 2001 22:56:06 +0900 (JST) From: non@ever.sanda.gr.jp Received: from localhost (localhost [127.0.0.1]) by ever.sanda.gr.jp (8.8.8/3.3W9) with ESMTP id WAA21304 for ; Sat, 10 Feb 2001 22:56:06 +0900 (JST) To: freebsd-hackers@freebsd.org Subject: Re: mount checking for read-only media In-Reply-To: <3A841662.B061A317@netzero.net> References: <3A837A0A.DAB3520A@columbus.rr.com> <20010209181342S.non@ever.sanda.gr.jp> <3A841662.B061A317@netzero.net> X-Mailer: Mew version 1.94 on Emacs 19.28 / Mule 2.3 =?iso-2022-jp?B?KBskQkt2RSYyVhsoQik=?= Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010210225605B.non@ever.sanda.gr.jp> Date: Sat, 10 Feb 2001 22:56:05 +0900 X-Dispatcher: imput version 20000228(IM140) Lines: 18 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I wrote this in -current ML too, From: Kevin Brunelle Date: Fri, 09 Feb 2001 11:10:10 -0500 > > It's not system call but `od' driver does check if the medium is > > writable or not. It returns EACCESS when the mount option is -rw and > > the medium is read-only. `od' is drived from `da' so quick hack will > > do the trick. > > This is all for scsi drives. I may not know everything, but I know most > floppies aren't scsi! But, I am sure the problem exists for both. I know Are there any reason not to check the device is writable or not, if its opened with a write flag ? Just returning error when open() call prevents this problem. // Noriaki Mitsunaga // To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message