Subject: Re: mandatory vnops and vfsops
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 05/14/2002 10:31:02
Emmanuel Dreyfus wrote:
> 1) non standard ioctl handing: most ioctl on /dev/usemaclone are defined
> as plain _IO (not R, not W), but they do use the data argument: they are
> really _IOR. I have to write a special handling in irix_sys_ioctl, which
> will directly call the driver method without going through sys_ioctl.

Well, the only difference for your driver is that generic function
won't do the final copyout implicitly, you'd do that from usemaclone's
ioctl function directly. Not a big deal at all and no need to
add hooks to irix_sys_ioctl.
 
> 2) one ioctl sets the return value. I can workaround this by setting
> data to a place in the stackgap, in irix_sys_ioctl, then copying the
> return value to the place pointed by data in the stackgap in the ioctl
> method, then getting in from the stackgap when I'm back in
> irix_sys_ioctl and set retval. Of course this remains simple because
> this ioctl does not uses data in IRIX.

Return value for what? Other ioctls?
 
> 3) libc does a fchmod on /dev/usemaclone once it is open. The operation
> will fail because root owns the device, but on IRIX, fchmod will return
> 0. libc expects this behavior and the program will fail if it is not
> properly emulated. I therefore have to overload the setattr vnode
> operation.

Well, I think it would be better to add hooks to irix_sys_fchmod()
rather than definining new fileops.
What is that fchmod() for BTW? Is it some kind of replacement of
BSD revoke(2)?

Jaromir 

> Problems #1 and #2 are orthogonal to the cloning device problem. Problem
> #3 forces me to define a new vnode vector anyway, whether if I use devvp
> or not. Except if someone has a better idea on how to handle this.
> 
> -- 
> Emmanuel Dreyfus.  
> Hiroshima 45. Tchernobyl 86. Windows 95. 
> manu@netbsd.org    
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-