[PATCH 4/5] Update linux/ioctlent.h.in file

Dmitry V. Levin ldv at altlinux.org
Thu Jan 15 23:39:07 UTC 2015


On Thu, Jan 15, 2015 at 12:03:20PM -0800, enh wrote:
> is there anything we can do about the SND* mess? the most common
> conflict i see on Android is the same one i see on my desktop:
> 
> ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or
> TCGETS, {B38400 opost isig icanon echo ...}) = 0
> 
> Android does use _some_ of the SND* ioctls, so i don't want to just
> hack them all out of our strace.

strace uses only 16 bits (8-bit number and 8-bit type) of the 32-bit ioctl
command, so the only real solution to this issue is to take into account
remaining 16 bits (size and direction).

For example,
SNDCTL_TMR_TIMEBASE is _IOC(_IOC_READ|_IOC_WRITE, 'T', 1, sizeof(int)),
SNDRV_TIMER_IOCTL_NEXT_DEVICE is _IOC(_IOC_READ|_IOC_WRITE, 'T', 1, sizeof(struct snd_timer_id)),
TCGETS is architecture-specific, its generic value 0x5401 is _IOC(0, 'T', 1, 0).

As you can see all these 32-bit values are different.
The only question is how to evaluate these remaining bits reliably, especially
14 bits (or 13 on alpha, mips, powerpc, and sparc) of ioctl command size.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150116/eb984040/attachment.bin>


More information about the Strace-devel mailing list