sparc64 (and others): fix tty_ioctl.c build

Add Guards around TIOCSLCKTRMIOS and TIOCGLCKTRMIOS.

Several architectures are still broken. Put temporary-for-2.6.23 ifdef guards
around the offending code.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by:: Linus Torvalds <torvalds@linux-foundation.org>

authored by Tony Breeds and committed by Linus Torvalds bb8bd3a5 2605a103

+14
+14
drivers/char/tty_ioctl.c
··· 795 795 if (L_ICANON(tty)) 796 796 retval = inq_canon(tty); 797 797 return put_user(retval, (unsigned int __user *) arg); 798 + #ifndef TCGETS2 799 + case TIOCGLCKTRMIOS: 800 + if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) 801 + return -EFAULT; 802 + return 0; 803 + 804 + case TIOCSLCKTRMIOS: 805 + if (!capable(CAP_SYS_ADMIN)) 806 + return -EPERM; 807 + if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) 808 + return -EFAULT; 809 + return 0; 810 + #else 798 811 case TIOCGLCKTRMIOS: 799 812 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) 800 813 return -EFAULT; ··· 819 806 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) 820 807 return -EFAULT; 821 808 return 0; 809 + #endif 822 810 823 811 case TIOCPKT: 824 812 {