Subject: Re: Question on ioctl
To: None <netbsd-users@netbsd.org>
From: David Laight <dsl@l8s.co.uk>
List: netbsd-users
Date: 02/15/2002 20:58:08
On Fri, Feb 15, 2002 at 08:37:39PM +0100, Martin Husemann wrote:
> > Is this format for 'request' enforced anywhere in NetBsd, or is
> > it just a convention?
>
> Well, this is used to copy the argument between kernel and user space. So
> if you don't follow it, be sure to mark the ioctl as IOC_VOID.
>
> I am not sure what you are trying to achive, but it sounds like an ugly
> and unnecessary hack.
Well SVR4 and Solaris drivers will call copyin() or copyout() (or
some message pair if Streams drivers) to read/write a user buffer.
This means there is no constraint on the ioctl 'request', nor the
structure of any associated buffer area. I call this flexibility
not a hack :-)
David