我正在移植一些将tty_ldisc_ops.ioctl()
定义为:
static int ...ldisc_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
static int ...ldisc_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
关于"文件"的争论发生了什么?我查找了更改日志(log)和来源.
我从(https://mirrors.edge.kernel.org/pub/linux/kernel/v2.1/)中随机抓取了一个较旧的内核.
int n_tty_ioctl(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg) { ... tty->driver.ioctl(tty, file, cmd, arg); ...
tty.h, struct tty_struct { ... struct tty_driver driver; ...
tty_driver.h: struct tty_driver { ... int (*ioctl)(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); ...
然后线索就断了.