Re: Why side-effects on open(2) are evil. (was Re: [RFD w/info-PATCH]device arguments from lookup)

Marko Kreen (marko@l-t.ee)
Sun, 27 May 2001 23:50:31 +0200


On Sun, May 27, 2001 at 10:45:17PM +0200, Daniel Phillips wrote:
> On Sunday 27 May 2001 15:32, Edgar Toernig wrote:
> > Daniel Phillips wrote:
> > > I'm not claiming there isn't breakage somewhere,
> >
> > you break UNIX fundamentals. But I'm quite relieved now because I'm
> > pretty sure that something like that will never go into the kernel.
>
> OK, I'll take that as "I couldn't find a piece of code that breaks, so
> it's on to the legal issues".
>
> SUS doesn't seem to have a lot to say about this. The nearest thing to
> a ruling I found was "The special filename dot refers to the directory
> specified by its predecessor". Which is not the same thing as:
>
> open("foo", O_RDONLY) == open ("foo/.", O_RDONLY)
>
> I don't know about POSIX (I don't have it: a pox on standards
> organizations that don't make their standards freely available) but SUS
> doesn't seem to forbid this.

My question is: Is it needed? You are advocating quite
non-obvious behaviour on a UNIX-like fs. Cant the end result
achieved in more obvious manner?

I see at most 3 types of magic files:

1) regular file - nothing special. Whether it has CHR/BLK set
or not is irrelevant.

2) file with subdevs. As 1) but you can acces dev/something
for subdev 'something'. Permissions should be probably taken
from 'dev'. Ofcourse you cant do 'ls' on the thing.

3) magicdev as directory. Act as ordinary directory. Only
reason is to group devices.

And all those should be manageable by devfsd, so you can tell
devfsd to take subdev and create it as file somewhere else.
So 2) and 3) are more like 'defaults'.

So: is there additional type required with non-obvious file/dir
behaviour mix?

-- 
marko

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/