ioctl() forever?
ioctl() forever?
Posted Jun 9, 2022 6:55 UTC (Thu) by pm215 (subscriber, #98099)In reply to: ioctl() forever? by koverstreet
Parent article: ioctl() forever?
I think a lot of the problem is that the kernel refuses to define its ABI in any other way than "here's a pile of header files, and if you're lucky also some documentation". This is a pain for any case except "I'm a C program". ioctl isn't the only offender here either -- setsockopt is another "feed arbitrary data structures via a generic-looking interface" mechanism.
QEMU's user-mode emulation runs into trouble with these things because we have to convert from guest architecture struct layout and endianness to host layout and endianness; without a machine-readable definition of what's being passed around by ioctl and similar syscalls we have to hand-roll support for every new ioctl somebody cares about. And every so often we run into one that's just straight-up not even documented.
