Subject: Re: IOCTL implementation and kernel/userland addresses
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 02/12/2005 16:10:07
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Feb 12, 2005 at 02:25:17PM +0100, Reinoud Zandijk wrote:
> > Won't this cause problems if the ioctl wants to sleep ?
> 
> that might be an issue yes.... a solution could be to add a flag to the 
> `flag' int as passed in the ioctl handler: 
> 
> ...ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, proc *p)
> 
> Since its not documentated wich values this `flag' argument can have, i 
> can't add it now for a test-patch.

AHUM, reading <sys/fcntl.h> i read that its FREAD, FWRITE flags and 
friends.... so a FKERNELADDR could be added indeed.

> 
> Still apart from this messaging of kernel/userland space, wouldn't it be 
> nice to have a kind of `copyout' function that would DTRT in all 
> situations?

hmmm add the flags to copyout() and the like? i.e. copyout(flags, ...)

Cheers,
Reinoud


--17pEHd4RhPHOinZp
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQg4cR4KcNwBDyKpoAQJr+QgAqXMAePxpGnS6t75xcivTccbIRXI0WawE
+lcUBv5t+cLbb7FXoVVvsJTfQ3soX0A+PsT6Y+MWI5dwuWmro0CQQWkCcdD1BEaQ
kuPnk+u/IN9dNGg9wXxgFuMLaR7ZXSIGPNjKfYwMZmI+Y6++gc1yE9TsiczXhU3B
lDjtGTK0wQr9zPgdN/MFil8IyIQjfy+o24hbR3LEHybS2J2kswaFQcORWKyVXkgT
fjaLWU/qw/VkAU2IH3zD2YJWX9DBxeUfOG8S6Kfk1UX+I0nyHnqppMefdyFQ6V9m
GcS+v9rmsGJGKI4rJjzKv7SnRVRGuo9xwohzwkD9du8U96CYFw+58g==
=pjxW
-----END PGP SIGNATURE-----

--17pEHd4RhPHOinZp--