A more useful way to interact with the driver
static ssize_t ioctl_handler(struct file *file, unsigned int cmd, unsigned long arg) {
printk("Command: %d; Argument: %d", cmd, arg);
return 0;
}#include <sys/ioctl.h>
// [...]
ioctl(fd, 0x100, 0x12345678); // data is a stringstatic struct file_operations fops = {
.ioctl = ioctl_handler
};static struct file_operations fops = {
.compat_ioctl = ioctl_handler,
.unlocked_ioctl = ioctl_handler
};