Re: util-linux-2.12: did you find a fix?

From: Sinelnikov Evgeny
Date: Sun Oct 19 2003 - 13:22:10 EST


> I read your email on LKML about the problem compiling util-linux-2.12
> with linux-2.6.0-test5 headers (the problem with _IOC_TYPECHECK).
> Did you find a way to fix the problem? If you solved it, could you tell
> me how to fix the util-linux problem?

I solved it so:
asm/ioctl.h:
...............
/* used to create numbers */
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
#define _IOR(type,nr,size)
_IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
#define _IOW(type,nr,size)
_IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
#define _IOWR(type,nr,size)
_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
#define _IOWR_BAD(type,nr,size)
_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
.....................
I patched all files that contains next defines:
_IOR, _IOW or _IOWR
with
_IOR_BAD, _IOW_BAD, _IOWR_BAD

Really it is not right.
But it would be so if I complie with 2.4.x headers

sizeof(sizeof(anymore)) is sizeof(int). And threre was int. Thus it was right
only there.

Sin (Sinelnikov Evgeny)

-
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/