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 14:25:17
--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hiya folks,

On Mon, Feb 07, 2005 at 07:40:36PM +0100, Manuel Bouyer wrote:
> On Mon, Feb 07, 2005 at 10:01:14AM -0800, Bill Studenmund wrote:
> > > Would proc still be NULL if the IOCTL is called from a kernel thread ?
> > 
> > We're making the semantics of such a call up as we go along. However I 
> > think that passing proc == NULL if the secondary addresses are in kernel 
> > space is reasonable.
> 
> 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.

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?

Cheers,
Reinoud


--cWoXeonUoKmBZSoM
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBQg4DtYKcNwBDyKpoAQKTuQgAneqMW//ubXrBiQehFrvPY/XMIv5y/jiC
pPi2wb6Cq1oXJ7By9ayfW4iP7wsjHyTIs09U1NI1TkqM2KYDhN9aT1jNTV1DvGAj
EamM1hlRKiv3sI4Lit3sE67aHIaWvMvCeQ632E+KOECOQHAD0Ew6N3PxWYqfbgaa
KZ2TxIhdhZsfU1IlatVX5YwoT+BHUAhN8RKL1bjXER/y2mWvBn4sJht5076PwfWe
A5wYUg1VMRAmXeHy29jWwixKrxdeOWfM+B5Ac/AEyJ4wvhVVKOvNlZgEUwTfYkDx
pnO5rKvuUgBwVi1hTAV8oLJxnHVT6IdihvnVJBvjXMM4ZFbm0VDqKw==
=Pxiy
-----END PGP SIGNATURE-----

--cWoXeonUoKmBZSoM--