]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/tty_ioctl.c
DCA: Add Direct Cache Access driver
[linux-2.6-omap-h63xx.git] / drivers / char / tty_ioctl.c
index 3423e9ee6481c1874898e448dc7e9712b3b33195..3ee73cf64bd215b2c95bff74790349e86af76708 100644 (file)
@@ -795,6 +795,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                        if (L_ICANON(tty))
                                retval = inq_canon(tty);
                        return put_user(retval, (unsigned int __user *) arg);
+#ifndef TCGETS2
                case TIOCGLCKTRMIOS:
                        if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
                                return -EFAULT;
@@ -806,6 +807,19 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
                        if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
                                return -EFAULT;
                        return 0;
+#else
+               case TIOCGLCKTRMIOS:
+                       if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
+                               return -EFAULT;
+                       return 0;
+
+               case TIOCSLCKTRMIOS:
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EPERM;
+                       if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
+                               return -EFAULT;
+                       return 0;
+#endif
 
                case TIOCPKT:
                {