diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2011-10-05 17:13:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-18 17:17:11 -0400 |
commit | 8193c4290620d9b2a6ac116719f11aa99053a90d (patch) | |
tree | 68f97623f0ae19ca5e6a31fda4cda4a1abf8c880 /drivers/tty/tty_ioctl.c | |
parent | 361162459f62dc0826b82c9690a741a940f457f0 (diff) |
tty: Support compat_ioctl get/set termios_locked
When running a Fedora 15 (x86) on an x86_64 kernel, in the boot process
plymouthd complains about those two missing ioctls:
[ 2.581783] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005457){t:'T';sz:0} arg(ffb6a5d0) on /dev/tty1
[ 2.581803] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005456){t:'T';sz:0} arg(ffb6a680) on /dev/tty1
both ioctl functions work on the 'struct termios' resp. 'struct termios2',
which has the same size (36 bytes resp. 44 bytes) on x86 and x86_64,
so it's just a matter of converting the pointer from userland.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/tty_ioctl.c')
-rw-r--r-- | drivers/tty/tty_ioctl.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/compat.h> | ||
22 | 23 | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -1179,3 +1180,19 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, | |||
1179 | } | 1180 | } |
1180 | } | 1181 | } |
1181 | EXPORT_SYMBOL(n_tty_ioctl_helper); | 1182 | EXPORT_SYMBOL(n_tty_ioctl_helper); |
1183 | |||
1184 | #ifdef CONFIG_COMPAT | ||
1185 | long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file, | ||
1186 | unsigned int cmd, unsigned long arg) | ||
1187 | { | ||
1188 | switch (cmd) { | ||
1189 | case TIOCGLCKTRMIOS: | ||
1190 | case TIOCSLCKTRMIOS: | ||
1191 | return tty_mode_ioctl(tty, file, cmd, (unsigned long) compat_ptr(arg)); | ||
1192 | default: | ||
1193 | return -ENOIOCTLCMD; | ||
1194 | } | ||
1195 | } | ||
1196 | EXPORT_SYMBOL(n_tty_compat_ioctl_helper); | ||
1197 | #endif | ||
1198 | |||