Re: How to register block device as read-only

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bernd Petrovitsch
Date: Saturday, July 28, 2007 - 4:36 am

On Fri, 2007-07-27 at 13:07 -0500, beck0778@umn.edu wrote:

Unless I misunderstand the question, the "write" and "writev" function
of the "struct file_operations" should return an appropriate error value
(which is here -EACCES).
You may think of returning an error in the "open" if someone wants to
open it to write to it (so that the must open it read-only).
But I don't know if that is common practice or not (or even disliked) as
it may interfere with not properly implemented tools which open devices
read-write even if they never write to it.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
How to register block device as read-only, beck0778, (Fri Jul 27, 11:07 am)
Re: How to register block device as read-only, Bernd Petrovitsch, (Sat Jul 28, 4:36 am)
Re: How to register block device as read-only, Jan Engelhardt, (Sat Jul 28, 4:43 am)