Re: [PATCH] cosa.h ioctl numbers
From: Jan Kasprzak
Date: Thu Dec 02 2004 - 11:01:56 EST
Andreas Schwab wrote:
: Jan Kasprzak <kas@xxxxxxxxxx> writes:
:
: > Andreas Schwab wrote:
: > : If you want real compatibility you should use size_t, which is what 2.4 is
: > : effectively using.
: > :
: > I assume that sizeof(struct .. *) == sizeof(size_t) on i386.
:
: This has nothing to do with this, but everything to do with
: sizeof(sizeof(foo)) == sizeof(size_t). And COSAIODOWNLD does not expect a
: pointer to a pointer but a pointer to struct cosa_download, which means
: that _IOW('C',0xf2,struct cosa_download *) would be completely wrong
: anyway.
I do not understand. The _IOW() macro just uses sizeof(_third_argument)
both on 2.4 and 2.6. And nothing else than sizeof() is done with the third
argument of _IOW(). So it does not matter what you put into the third
argument anyway, provided that you make sure the ABI (i.e. the type
and layout of the last argument to ioctl()) remains the same. The third
argument to _IOW() is just a (rather weak) helper which helps you to detect
the unwanted ABI change.
Yes, I made a (small) mistake when writing cosa.h during the
Linux 2.1 development cycle, but since nobody cared and I am pretty
sure I did not change the layout of struct cosa_download at all since
Linux 2.1, I would rather have the 2.6 ioctl numbers the same
as in 2.1-2.4.
-Yenya
--
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/ Czech Linux Homepage: http://www.linux.cz/ |
> Whatever the Java applications and desktop dances may lead to, Unix will <
> still be pushing the packets around for a quite a while. --Rob Pike <
-
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/