Re: PROBLEM: 2.6.0-test5: ioctl.h: _IOC_TYPECHECK: Is it a bug?

From: Andries Brouwer
Date: Sun Oct 19 2003 - 16:16:06 EST


On Thu, Oct 09, 2003 at 11:39:04PM +0400, Sinelnikov Evgeny wrote:

> I have problem with linux-utils.2.12 compile on 2.6.0-test5 headers. From this
> version instead 2.6.0-test4 was changed next file where added next string:
>
> include/asm-i386/ioctl.h:
> #define _IOC_TYPECHECK(t) \
> ((sizeof(t) == sizeof(t[1]) && \
> sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
> sizeof(t) : __invalid_size_argument_for_IOC)
>
> This string have problems with compiling files using _IOR macros from ioctl.h
> Here is example from util-linux-2.12:
> #define BLKBSZGET _IOR(0x12,112,sizeof(int))

Normally, user space includes <sys/ioctl.h>, which again includes
<asm/ioctl.h> which defines _IOR etc.

It sounds like you use a symlink /usr/include/asm into a kernel source tree.
Doing such things is discouraged. For people that follow kernel development
the kernel source tree changes from day to day. When some utility shows
obscure errors it would be necessary to recall when, and with what kernel
headers it was last compiled in order to debug the problem. That is not good
for stability and reproducibility.

Moreover, there are no guarantees that kernel headers work in user space.
Often they do for some kernel versions and don't for other kernel versions.
It is the task of the distributor of include files to pick a suitable set.

Finally, when something is wrong with util-linux, please tell aeb@xxxxxxx
(There used to be a mailing list but I think it has been killed since
the recent spam floods.)

Andries

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