
From: Anries.Brouwer@cwi.nl

Remove TIOCTTYGSTRUCT.  We're copying a complex internal kernel data
structure direct to userspace and this causes dev_t pain.



 25-akpm/drivers/char/tty_io.c        |   10 ----------
 25-akpm/include/asm-alpha/ioctls.h   |    1 -
 25-akpm/include/asm-arm/ioctls.h     |    1 -
 25-akpm/include/asm-cris/ioctls.h    |    1 -
 25-akpm/include/asm-i386/ioctls.h    |    4 ++--
 25-akpm/include/asm-ia64/ioctls.h    |    1 -
 25-akpm/include/asm-m68k/ioctls.h    |    1 -
 25-akpm/include/asm-mips/ioctls.h    |   14 ++++++--------
 25-akpm/include/asm-mips64/ioctls.h  |   14 ++++++--------
 25-akpm/include/asm-parisc/ioctls.h  |    1 -
 25-akpm/include/asm-ppc/ioctls.h     |    1 -
 25-akpm/include/asm-ppc/termios.h    |    1 -
 25-akpm/include/asm-ppc64/ioctls.h   |    1 -
 25-akpm/include/asm-ppc64/termios.h  |    1 -
 25-akpm/include/asm-s390/ioctls.h    |    1 -
 25-akpm/include/asm-s390x/ioctls.h   |    1 -
 25-akpm/include/asm-sh/ioctls.h      |    1 -
 25-akpm/include/asm-sparc/ioctls.h   |    1 -
 25-akpm/include/asm-sparc64/ioctls.h |    1 -
 25-akpm/include/asm-v850/ioctls.h    |    1 -
 25-akpm/include/asm-x86_64/ioctls.h  |    1 -
 21 files changed, 14 insertions(+), 45 deletions(-)

diff -puN drivers/char/tty_io.c~kill-TIOCTTYGSTRUCT drivers/char/tty_io.c
--- 25/drivers/char/tty_io.c~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/drivers/char/tty_io.c	Mon Mar 31 16:10:47 2003
@@ -1662,13 +1662,6 @@ static int tiocgsid(struct tty_struct *t
 	return put_user(real_tty->session, arg);
 }
 
-static int tiocttygstruct(struct tty_struct *tty, struct tty_struct *arg)
-{
-	if (copy_to_user(arg, tty, sizeof(*arg)))
-		return -EFAULT;
-	return 0;
-}
-
 static int tiocsetd(struct tty_struct *tty, int *arg)
 {
 	int ldisc;
@@ -1795,9 +1788,6 @@ int tty_ioctl(struct inode * inode, stru
 		case TIOCLINUX:
 			return tioclinux(tty, arg);
 #endif
-		case TIOCTTYGSTRUCT:
-			return tiocttygstruct(tty, (struct tty_struct *) arg);
-
 		/*
 		 * Break handling
 		 */
diff -puN include/asm-alpha/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-alpha/ioctls.h
--- 25/include/asm-alpha/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-alpha/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -86,7 +86,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-arm/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-arm/ioctls.h
--- 25/include/asm-arm/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-arm/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,7 +43,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-cris/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-cris/ioctls.h
--- 25/include/asm-cris/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-cris/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -45,7 +45,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-i386/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-i386/ioctls.h
--- 25/include/asm-i386/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-i386/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,14 +43,14 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
+/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
 #define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
 #define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
 
-#define FIONCLEX	0x5450  /* these numbers need to be adjusted. */
+#define FIONCLEX	0x5450
 #define FIOCLEX		0x5451
 #define FIOASYNC	0x5452
 #define TIOCSERCONFIG	0x5453
diff -puN include/asm-ia64/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-ia64/ioctls.h
--- 25/include/asm-ia64/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-ia64/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -48,7 +48,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-m68k/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-m68k/ioctls.h
--- 25/include/asm-m68k/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-m68k/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,7 +43,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-mips64/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-mips64/ioctls.h
--- 25/include/asm-mips64/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-mips64/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -74,6 +74,12 @@
 /* #define TIOCSETD	_IOW('t', 27, int)	set line discipline */
 						/* 127-124 compat */
 
+#define TIOCSBRK	0x5427  /* BSD compatibility */
+#define TIOCCBRK	0x5428  /* BSD compatibility */
+#define TIOCGSID	0x7416  /* Return the session ID of FD */
+#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
+
 /* I hope the range from 0x5480 on is free ... */
 #define TIOCSCTTY	0x5480		/* become controlling tty */
 #define TIOCGSOFTCAR	0x5481
@@ -81,15 +87,7 @@
 #define TIOCLINUX	0x5483
 #define TIOCGSERIAL	0x5484
 #define TIOCSSERIAL	0x5485
-
 #define TCSBRKP		0x5486	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5487  /* For debugging only */
-#define TIOCSBRK	0x5427  /* BSD compatibility */
-#define TIOCCBRK	0x5428  /* BSD compatibility */
-#define TIOCGSID	0x7416  /* Return the session ID of FD */
-#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
-
 #define TIOCSERCONFIG	0x5488
 #define TIOCSERGWILD	0x5489
 #define TIOCSERSWILD	0x548a
diff -puN include/asm-mips/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-mips/ioctls.h
--- 25/include/asm-mips/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-mips/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -74,6 +74,12 @@
 /* #define TIOCSETD	_IOW('t', 27, int)	set line discipline */
 						/* 127-124 compat */
 
+#define TIOCSBRK	0x5427  /* BSD compatibility */
+#define TIOCCBRK	0x5428  /* BSD compatibility */
+#define TIOCGSID	0x7416  /* Return the session ID of FD */
+#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
+
 /* I hope the range from 0x5480 on is free ... */
 #define TIOCSCTTY	0x5480		/* become controlling tty */
 #define TIOCGSOFTCAR	0x5481
@@ -81,15 +87,7 @@
 #define TIOCLINUX	0x5483
 #define TIOCGSERIAL	0x5484
 #define TIOCSSERIAL	0x5485
-
 #define TCSBRKP		0x5486	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5487  /* For debugging only */
-#define TIOCSBRK	0x5427  /* BSD compatibility */
-#define TIOCCBRK	0x5428  /* BSD compatibility */
-#define TIOCGSID	0x7416  /* Return the session ID of FD */
-#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
-
 #define TIOCSERCONFIG	0x5488
 #define TIOCSERGWILD	0x5489
 #define TIOCSERSWILD	0x548a
diff -puN include/asm-parisc/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-parisc/ioctls.h
--- 25/include/asm-parisc/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-parisc/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,7 +43,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	_IOR('T', 20, int) /* Return the session ID of FD */
diff -puN include/asm-ppc64/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-ppc64/ioctls.h
--- 25/include/asm-ppc64/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-ppc64/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -90,7 +90,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-ppc64/termios.h~kill-TIOCTTYGSTRUCT include/asm-ppc64/termios.h
--- 25/include/asm-ppc64/termios.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-ppc64/termios.h	Mon Mar 31 16:10:47 2003
@@ -152,7 +152,6 @@ struct termio {
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 
 #define TIOCSERCONFIG	0x5453
 #define TIOCSERGWILD	0x5454
diff -puN include/asm-ppc/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-ppc/ioctls.h
--- 25/include/asm-ppc/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-ppc/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -83,7 +83,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-ppc/termios.h~kill-TIOCTTYGSTRUCT include/asm-ppc/termios.h
--- 25/include/asm-ppc/termios.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-ppc/termios.h	Mon Mar 31 16:10:47 2003
@@ -97,7 +97,6 @@ struct ltchars {
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 
 #define TIOCSERCONFIG	0x5453
 #define TIOCSERGWILD	0x5454
diff -puN include/asm-s390/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-s390/ioctls.h
--- 25/include/asm-s390/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-s390/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -51,7 +51,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-s390x/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-s390x/ioctls.h
--- 25/include/asm-s390x/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-s390x/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -51,7 +51,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-sh/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-sh/ioctls.h
--- 25/include/asm-sh/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-sh/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -75,7 +75,6 @@
 #define TIOCSETD	_IOW('T', 35, int) /* 0x5423 */
 #define TIOCGETD	_IOR('T', 36, int) /* 0x5424 */
 #define TCSBRKP		_IOW('T', 37, int) /* 0x5425 */	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	_IOR('T', 38, struct tty_struct) /* 0x5426 */ /* For debugging only */
 #define TIOCSBRK	_IO('T', 39) /* 0x5427 */ /* BSD compatibility */
 #define TIOCCBRK	_IO('T', 40) /* 0x5428 */ /* BSD compatibility */
 #define TIOCGSID	_IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
diff -puN include/asm-sparc64/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-sparc64/ioctls.h
--- 25/include/asm-sparc64/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-sparc64/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -100,7 +100,6 @@
 #define TIOCGSERIAL	0x541E
 #define TIOCSSERIAL	0x541F
 #define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
 #define TIOCSERCONFIG	0x5453
 #define TIOCSERGWILD	0x5454
 #define TIOCSERSWILD	0x5455
diff -puN include/asm-sparc/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-sparc/ioctls.h
--- 25/include/asm-sparc/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-sparc/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -99,7 +99,6 @@
 #define TIOCGSERIAL	0x541E
 #define TIOCSSERIAL	0x541F
 #define TCSBRKP		0x5425
-#define TIOCTTYGSTRUCT	0x5426
 #define TIOCSERCONFIG	0x5453
 #define TIOCSERGWILD	0x5454
 #define TIOCSERSWILD	0x5455
diff -puN include/asm-v850/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-v850/ioctls.h
--- 25/include/asm-v850/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-v850/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,7 +43,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */
diff -puN include/asm-x86_64/ioctls.h~kill-TIOCTTYGSTRUCT include/asm-x86_64/ioctls.h
--- 25/include/asm-x86_64/ioctls.h~kill-TIOCTTYGSTRUCT	Mon Mar 31 16:10:47 2003
+++ 25-akpm/include/asm-x86_64/ioctls.h	Mon Mar 31 16:10:47 2003
@@ -43,7 +43,6 @@
 #define TIOCSETD	0x5423
 #define TIOCGETD	0x5424
 #define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
 #define TIOCSBRK	0x5427  /* BSD compatibility */
 #define TIOCCBRK	0x5428  /* BSD compatibility */
 #define TIOCGSID	0x5429  /* Return the session ID of FD */

_
