diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/tty_io.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_ioctl.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 150e4f747c7..4ca4bcd28ff 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2717,6 +2717,8 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd, ld = tty_ldisc_ref_wait(tty); if (ld->ops->compat_ioctl) retval = ld->ops->compat_ioctl(tty, file, cmd, arg); + else + retval = n_tty_compat_ioctl_helper(tty, file, cmd, arg); tty_ldisc_deref(ld); return retval; diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index 53f2442c609..9314d93c1a2 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -19,6 +19,7 @@ #include <linux/module.h> #include <linux/bitops.h> #include <linux/mutex.h> +#include <linux/compat.h> #include <asm/io.h> #include <asm/uaccess.h> @@ -1179,3 +1180,19 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, } } EXPORT_SYMBOL(n_tty_ioctl_helper); + +#ifdef CONFIG_COMPAT +long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file, + unsigned int cmd, unsigned long arg) +{ + switch (cmd) { + case TIOCGLCKTRMIOS: + case TIOCSLCKTRMIOS: + return tty_mode_ioctl(tty, file, cmd, (unsigned long) compat_ptr(arg)); + default: + return -ENOIOCTLCMD; + } +} +EXPORT_SYMBOL(n_tty_compat_ioctl_helper); +#endif + |