[227] in linux-scsi channel archive
Re: st driver open(O_WRONLY) of write-protected tape
daemon@ATHENA.MIT.EDU (Matthias Urlichs)
Mon Jun 5 00:51:09 1995
To: submit-linux-dev-scsi@ratatosk.yggdrasil.com
From: urlichs@smurf.noris.de (Matthias Urlichs)
Date: 4 Jun 1995 23:12:48 +0200
In linux.dev.scsi, article <Pine.OSF.3.91.950604102133.3060A-100000@abies.metla.fi>,
Kai Makisara <makisara@abies.metla.fi> writes:
>
> The quick patch at the end of this message changes the behaviour so that
> the tar problem disappears. Returning EPERM if a write-protected tape is
> opened O_WRONLY is certainly sensible but should we do that also for O_RDWR?
>
Why EPERM? We went through that one in comp.os.linux.development.system for
floppies. The (IMHO) correct result code is EROFS, which effectively means
"read-only media in drive" (the grudging consensus was to ignore the
last two characters).
EPERM means "the permission bits on the file don't match what you're trying
to do". The write-protect tab / slider / thingie on the media can be
considered a bit, but not on the device file. ;-)
--
Logicians do it or they do not do it.
--
Matthias Urlichs \ XLink-POP Nürnberg | EMail: urlichs@smurf.noris.de
Schleiermacherstraße 12 \ Unix+Linux+Mac | Phone: ...please use email.
90491 Nürnberg (Germany) \ Consulting+Networking+Programming+etc'ing 42
PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE
Click <A HREF="http://smurf.noris.de/~urlichs/finger">here</A>.