<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">I'm trying to figure out how those ioctl decoders actually work. I</div><div dir="ltr">found that ioctl entries in strace are always updated according to</div><div dir="ltr">linux kernel's updates and I wonder how we can make the decoders</div><div dir="ltr">compatible when we are on an OS with older kernel headers. </div><div dir="ltr">I've been recently doing research about DRM ioctl and I saw those</div><div dir="ltr">related structures are updated frequently. For example,</div><div dir="ltr">'struct drm_mode_get_connector' had been added a u32 padding in linux</div><div dir="ltr">v3.12 so in /strace/linux/32/ioctls_inc_aligned32.h the size of it was </div><div dir="ltr">updated to 0x50. But when the kernel headers are bit older, the size of</div><div dir="ltr">this struct is 0x4c. In this case it seems the decoder will not work as</div><div dir="ltr">expected because the output will be something like:</div><div dir="ltr"><br></div><div dir="ltr">'ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0xa7, 0x4c), NULL) = -1 EBADF (Bad file descriptor)'</div><div dir="ltr">because according to /strace/linux/32/ioctls_inc_aligned32.h it's a</div><div dir="ltr">80-byte struct. Is there any commonly acceptable way to avoid/resolve</div><div dir="ltr">this? Or any materials I can refer to? </div><div dir="ltr"><br></div><div dir="ltr">Thanks,</div><div dir="ltr">Zhibin Li</div></div></div></div></div>