2011-04-30 14:18:45

by Thomas Meyer

[permalink] [raw]
Subject: [PATCH] Support compat_ioctl get/set termios_locked

plymouth complains about those two missing ioctls.

Signed-off-by: Thomas Meyer <[email protected]>
---
drivers/tty/n_tty.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 428f4fe..8d1073f 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -40,6 +40,7 @@
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/ctype.h>
+#include <linux/compat.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/slab.h>
@@ -2088,6 +2089,20 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
}
}

+#ifdef CONFIG_COMPAT
+static long n_tty_compat_ioctl(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;
+ }
+}
+#endif
+
struct tty_ldisc_ops tty_ldisc_N_TTY = {
.magic = TTY_LDISC_MAGIC,
.name = "n_tty",
@@ -2098,6 +2113,9 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
.read = n_tty_read,
.write = n_tty_write,
.ioctl = n_tty_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = n_tty_compat_ioctl,
+#endif
.set_termios = n_tty_set_termios,
.poll = n_tty_poll,
.receive_buf = n_tty_receive_buf,
--
1.7.4.4