Re: ioctl cleanups: enable sg_io and serial stuff to be shared

From: Arnd Bergmann (arnd@arndb.de)
Date: Thu May 08 2003 - 10:23:19 EST


Gerd Knorr wrote:

> ioctl struct size and the ioctl number (which has the size encoded)
> should end up being different too. Anyone aware of corner cases where
> this isn't going to work?

About half of the ioctls that need special care have fixed numbers
instead of using _IOR() etc, see e.g. include/linux/sockios.h,
or they get the definition wrong in some way.

The way you do it in your patch could work for many cases, but it
won't be enough to eliminate HANDLE_IOCTL(), if that is desired.

Adding fops->compat_ioctl() makes it possible to eventually replace
all HANDLE_IOCTL() and keep only COMPATIBLE_IOCTL(), which in turn
would become simpler to deal with.
If we don't add fops->compat_ioctl(), the ioctl handlers could
however look at (current_thread_info()->flags & _TIF_32BIT) to find
out if which user data structure they should expect. Is that reliable?
Do we already have a macro to do it?

        Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:28 EST