Subject: Re: Addition to force open to open only regular files
To: Simon Burge <simonb@wasabisystems.com>
From: Greywolf <greywolf@starwolf.com>
List: tech-kern
Date: 11/12/2000 11:25:16
On Sun, 12 Nov 2000, Simon Burge wrote:

# Date: Sun, 12 Nov 2000 21:14:16 +1100
# From: Simon Burge <simonb@wasabisystems.com>
# To: tech-kern@netbsd.org
# Subject: Re: Addition to force open to open only regular files 
# 
# Greywolf wrote:
# 
# > On 10 Nov 2000, Nathan J. Williams wrote:
# > 
# > # > So here are patches which add a new open flag, O_REG_FILE, and add a test
# > # > to the kernel after we've done the name lookup but before we've done the
# > # > VOP_OPEN() to make sure we really got a regular file.
# > # > 
# > # > Thoughts?
# > # 
# > # ``Yuck''.
# > 
# > Agreed.
# > 
# > If you're concerned about the type of file you're opening, OPEN the thing
# > and then fstat(fd) it.  If it's not the right type, act appropriately,
# > whether that means looping on trying to open something (based on user
# > input) or abort and bitch.
# 
# It's that act of opening and then closing a file that would, for
# example, cause a tape drive to rewind or eject.  By then it's too
# late - fstat() will only tell you that the tape device you just
# opened will eject when you close the device.

Personally, I think the idea of doing an eject on close might be better
solved on a flag given to the device on open rather than via a minor
number, or a control device for the magtapes by which one could assign
characteristics to the devices in qestion...?

Perhaps "minor numbers are evil", now?  I don't know.

# While I don't entirely like the idea of this patch, I can not see
# any other (cleaner) way to deal with this particular issue.  For
# this reason, I will support it's inclusion into NetBSD.

Yeah, the above suggestions would just mangle the current defined
behviour too much.  Just trying to think (but nothing happens).

				--*greywolf;
--
*BSD: Stable and strong!