Subject: Re: /dev/stdout wierdness
To: Bill Studenmund <wrstuden@zembu.com>
From: None <jchacon@genuity.net>
List: tech-userlevel
Date: 03/01/2001 16:36:07
>
>On Thu, 1 Mar 2001, Charles M. Hannum wrote:
>
>>
>> > Yeah, this means vn_open() needs to be changed too :)
>>
>> The real problem here looks to me like: even though fdesc uses its own
>> shadow vnodes, it forwards getattr and setattr requests on to the
>> underlying vnode. If we simply removed that garbage, the setattr would
>> fail in ~the same way it does in the non-fdesc case, and this problem
>> would go away.
>
>I agree that the setattr forwarding is the problem, and it is where the
>fix should be.
>
>I do though think there might be times when it makes sense to forward the
>setattr call on, since if I open a file r/w, and then open that file
>descriptor via fdevfs, I should be able to do the same things to each
>file descriptor (like truncate, etc).
I could see where that might be useful, but that's in direct contrast to
the documentation today and normal expectations.
Basically if you want to extend what you've done to the modes, call the
appropriate ftruncate, fcntl, lseek, etc to do that so it's explicit (rather
than implicit which is what threw off the sort fopen ("/dev/stdout", "w") case)
I'll fix the current fdsesc stuff to do what the docs say tonight and test
against my test cases to make sure it all works. I'm not going anywhere
near to VOP_OPEN ideas though :-)
James