linux-pages.com
... arcane linux knowledge collected over the eons, bit by bit ...
Consider this situation:
You app gets to the point where it executes an ioctl syscall and returns an error, e.g.
if (ioctl(fd, STVMIX_IOC_DISCONNECTLAYERS, &STVMIX_Ioctl_DisconnectLayers) != 0) { /* IOCTL failed */ ErrorCode = ST_ERROR_BAD_PARAMETER; printf (" STVMIX_DisconnectLayers():Ioctl error 0x%x\n", ErrorCode); }
Assuming that the module/driver source is available to y ou, how can you find out which function does the kernel call internally for this ioctl syscall?
Here’s the steps which should help you identify which function the ioctl calls internaly to handle your ioctl system call:
static struct file_operations stvmix_ioctl_fops = { open : stvmix_ioctl_open, read : stvmix_ioctl_read, write : stvmix_ioctl_write, ioctl : stvmix_ioctl_ioctl , release : stvmix_ioctl_release, };
In this example the ioctl callback is called stvmix_ioctl_ioctl