aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/include/asm/ioctls.h2
-rw-r--r--arch/alpha/include/asm/termbits.h1
-rw-r--r--arch/arm/include/asm/ioctls.h2
-rw-r--r--arch/arm/include/asm/termbits.h1
-rw-r--r--arch/avr32/include/asm/ioctls.h2
-rw-r--r--arch/avr32/include/asm/termbits.h1
-rw-r--r--arch/cris/include/asm/ioctls.h2
-rw-r--r--arch/cris/include/asm/termbits.h1
-rw-r--r--arch/frv/include/asm/ioctls.h2
-rw-r--r--arch/frv/include/asm/termbits.h1
-rw-r--r--arch/h8300/include/asm/ioctls.h2
-rw-r--r--arch/h8300/include/asm/termbits.h1
-rw-r--r--arch/ia64/include/asm/ioctls.h2
-rw-r--r--arch/ia64/include/asm/termbits.h1
-rw-r--r--arch/m32r/include/asm/ioctls.h2
-rw-r--r--arch/m32r/include/asm/termbits.h1
-rw-r--r--arch/m68k/include/asm/ioctls.h2
-rw-r--r--arch/m68k/include/asm/termbits.h1
-rw-r--r--arch/mips/include/asm/ioctls.h3
-rw-r--r--arch/mips/include/asm/termbits.h1
-rw-r--r--arch/mn10300/include/asm/ioctls.h2
-rw-r--r--arch/mn10300/include/asm/termbits.h1
-rw-r--r--arch/parisc/include/asm/ioctls.h2
-rw-r--r--arch/parisc/include/asm/termbits.h1
-rw-r--r--arch/powerpc/include/asm/ioctls.h2
-rw-r--r--arch/powerpc/include/asm/termbits.h1
-rw-r--r--arch/s390/include/asm/ioctls.h2
-rw-r--r--arch/sh/include/asm/ioctls.h2
-rw-r--r--arch/sparc/include/asm/ioctls.h2
-rw-r--r--arch/sparc/include/asm/termbits.h1
-rw-r--r--arch/xtensa/include/asm/ioctls.h2
-rw-r--r--arch/xtensa/include/asm/termbits.h1
-rw-r--r--drivers/char/n_tty.c17
-rw-r--r--drivers/char/pty.c21
-rw-r--r--drivers/char/tty_ioctl.c18
-rw-r--r--fs/compat_ioctl.c1
-rw-r--r--include/asm-generic/ioctls.h2
-rw-r--r--include/asm-generic/termbits.h1
-rw-r--r--include/linux/tty.h1
39 files changed, 101 insertions, 10 deletions
diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/asm/ioctls.h
index c7b0cc61ce5b..59617c3c2be6 100644
--- a/arch/alpha/include/asm/ioctls.h
+++ b/arch/alpha/include/asm/ioctls.h
@@ -80,6 +80,7 @@
80# define TIOCPKT_START 8 80# define TIOCPKT_START 8
81# define TIOCPKT_NOSTOP 16 81# define TIOCPKT_NOSTOP 16
82# define TIOCPKT_DOSTOP 32 82# define TIOCPKT_DOSTOP 32
83# define TIOCPKT_IOCTL 64
83 84
84 85
85#define TIOCNOTTY 0x5422 86#define TIOCNOTTY 0x5422
@@ -91,6 +92,7 @@
91#define TIOCGSID 0x5429 /* Return the session ID of FD */ 92#define TIOCGSID 0x5429 /* Return the session ID of FD */
92#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 93#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
93#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 94#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
95#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
94 96
95#define TIOCSERCONFIG 0x5453 97#define TIOCSERCONFIG 0x5453
96#define TIOCSERGWILD 0x5454 98#define TIOCSERGWILD 0x5454
diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/asm/termbits.h
index ad854a4a3af6..879dd3589921 100644
--- a/arch/alpha/include/asm/termbits.h
+++ b/arch/alpha/include/asm/termbits.h
@@ -180,6 +180,7 @@ struct ktermios {
180#define FLUSHO 0x00800000 180#define FLUSHO 0x00800000
181#define PENDIN 0x20000000 181#define PENDIN 0x20000000
182#define IEXTEN 0x00000400 182#define IEXTEN 0x00000400
183#define EXTPROC 0x10000000
183 184
184/* Values for the ACTION argument to `tcflow'. */ 185/* Values for the ACTION argument to `tcflow'. */
185#define TCOOFF 0 186#define TCOOFF 0
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h
index 7f0b6d13296a..0b30894b5482 100644
--- a/arch/arm/include/asm/ioctls.h
+++ b/arch/arm/include/asm/ioctls.h
@@ -52,6 +52,7 @@
52#define TCSETSF2 _IOW('T',0x2D, struct termios2) 52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
55#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
55 56
56#define TIOCGRS485 0x542E 57#define TIOCGRS485 0x542E
57#define TIOCSRS485 0x542F 58#define TIOCSRS485 0x542F
@@ -81,6 +82,7 @@
81#define TIOCPKT_START 8 82#define TIOCPKT_START 8
82#define TIOCPKT_NOSTOP 16 83#define TIOCPKT_NOSTOP 16
83#define TIOCPKT_DOSTOP 32 84#define TIOCPKT_DOSTOP 32
85#define TIOCPKT_IOCTL 64
84 86
85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 87#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
86 88
diff --git a/arch/arm/include/asm/termbits.h b/arch/arm/include/asm/termbits.h
index f784d11f40b5..704135d28d1d 100644
--- a/arch/arm/include/asm/termbits.h
+++ b/arch/arm/include/asm/termbits.h
@@ -177,6 +177,7 @@ struct ktermios {
177#define FLUSHO 0010000 177#define FLUSHO 0010000
178#define PENDIN 0040000 178#define PENDIN 0040000
179#define IEXTEN 0100000 179#define IEXTEN 0100000
180#define EXTPROC 0200000
180 181
181/* tcflow() and TCXONC use these */ 182/* tcflow() and TCXONC use these */
182#define TCOOFF 0 183#define TCOOFF 0
diff --git a/arch/avr32/include/asm/ioctls.h b/arch/avr32/include/asm/ioctls.h
index 143dafb3997e..b7dd324b46a9 100644
--- a/arch/avr32/include/asm/ioctls.h
+++ b/arch/avr32/include/asm/ioctls.h
@@ -53,6 +53,7 @@
53#define TCSETSF2 _IOW('T',0x2D, struct termios2) 53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
56 57
57#define TIOCGRS485 0x542E 58#define TIOCGRS485 0x542E
58#define TIOCSRS485 0x542F 59#define TIOCSRS485 0x542F
@@ -82,6 +83,7 @@
82#define TIOCPKT_START 8 83#define TIOCPKT_START 8
83#define TIOCPKT_NOSTOP 16 84#define TIOCPKT_NOSTOP 16
84#define TIOCPKT_DOSTOP 32 85#define TIOCPKT_DOSTOP 32
86#define TIOCPKT_IOCTL 64
85 87
86#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 88#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
87 89
diff --git a/arch/avr32/include/asm/termbits.h b/arch/avr32/include/asm/termbits.h
index db2daab31fdb..366adc5ebb10 100644
--- a/arch/avr32/include/asm/termbits.h
+++ b/arch/avr32/include/asm/termbits.h
@@ -175,6 +175,7 @@ struct ktermios {
175#define FLUSHO 0010000 175#define FLUSHO 0010000
176#define PENDIN 0040000 176#define PENDIN 0040000
177#define IEXTEN 0100000 177#define IEXTEN 0100000
178#define EXTPROC 0200000
178 179
179/* tcflow() and TCXONC use these */ 180/* tcflow() and TCXONC use these */
180#define TCOOFF 0 181#define TCOOFF 0
diff --git a/arch/cris/include/asm/ioctls.h b/arch/cris/include/asm/ioctls.h
index bb49142dc6ab..c9129ed37443 100644
--- a/arch/cris/include/asm/ioctls.h
+++ b/arch/cris/include/asm/ioctls.h
@@ -54,6 +54,7 @@
54#define TCSETSF2 _IOW('T',0x2D, struct termios2) 54#define TCSETSF2 _IOW('T',0x2D, struct termios2)
55#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 55#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
56#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 56#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
57#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
57 58
58#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 59#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
59#define FIOCLEX 0x5451 60#define FIOCLEX 0x5451
@@ -85,6 +86,7 @@
85#define TIOCPKT_START 8 86#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16 87#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32 88#define TIOCPKT_DOSTOP 32
89#define TIOCPKT_IOCTL 64
88 90
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 91#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90 92
diff --git a/arch/cris/include/asm/termbits.h b/arch/cris/include/asm/termbits.h
index 66e1a7492a0c..1c43bc874ccf 100644
--- a/arch/cris/include/asm/termbits.h
+++ b/arch/cris/include/asm/termbits.h
@@ -214,6 +214,7 @@ struct ktermios {
214#define FLUSHO 0010000 214#define FLUSHO 0010000
215#define PENDIN 0040000 215#define PENDIN 0040000
216#define IEXTEN 0100000 216#define IEXTEN 0100000
217#define EXTPROC 0200000
217 218
218/* tcflow() and TCXONC use these */ 219/* tcflow() and TCXONC use these */
219#define TCOOFF 0 220#define TCOOFF 0
diff --git a/arch/frv/include/asm/ioctls.h b/arch/frv/include/asm/ioctls.h
index d0c30e31fbda..a993e3759ccf 100644
--- a/arch/frv/include/asm/ioctls.h
+++ b/arch/frv/include/asm/ioctls.h
@@ -53,6 +53,7 @@
53#define TCSETSF2 _IOW('T',0x2D, struct termios2) 53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
56 57
57#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 58#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
58#define FIOCLEX 0x5451 59#define FIOCLEX 0x5451
@@ -79,6 +80,7 @@
79#define TIOCPKT_START 8 80#define TIOCPKT_START 8
80#define TIOCPKT_NOSTOP 16 81#define TIOCPKT_NOSTOP 16
81#define TIOCPKT_DOSTOP 32 82#define TIOCPKT_DOSTOP 32
83#define TIOCPKT_IOCTL 64
82 84
83#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
84 86
diff --git a/arch/frv/include/asm/termbits.h b/arch/frv/include/asm/termbits.h
index 5568492b5086..7722e19cc349 100644
--- a/arch/frv/include/asm/termbits.h
+++ b/arch/frv/include/asm/termbits.h
@@ -180,6 +180,7 @@ struct ktermios {
180#define FLUSHO 0010000 180#define FLUSHO 0010000
181#define PENDIN 0040000 181#define PENDIN 0040000
182#define IEXTEN 0100000 182#define IEXTEN 0100000
183#define EXTPROC 0200000
183 184
184 185
185/* tcflow() and TCXONC use these */ 186/* tcflow() and TCXONC use these */
diff --git a/arch/h8300/include/asm/ioctls.h b/arch/h8300/include/asm/ioctls.h
index 98a53d067269..b6b249f9f308 100644
--- a/arch/h8300/include/asm/ioctls.h
+++ b/arch/h8300/include/asm/ioctls.h
@@ -53,6 +53,7 @@
53#define TCSETSF2 _IOW('T',0x2D, struct termios2) 53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
56 57
57#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 58#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
58#define FIOCLEX 0x5451 59#define FIOCLEX 0x5451
@@ -79,6 +80,7 @@
79#define TIOCPKT_START 8 80#define TIOCPKT_START 8
80#define TIOCPKT_NOSTOP 16 81#define TIOCPKT_NOSTOP 16
81#define TIOCPKT_DOSTOP 32 82#define TIOCPKT_DOSTOP 32
83#define TIOCPKT_IOCTL 64
82 84
83#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
84 86
diff --git a/arch/h8300/include/asm/termbits.h b/arch/h8300/include/asm/termbits.h
index 31eca81db3f7..3287a6244d74 100644
--- a/arch/h8300/include/asm/termbits.h
+++ b/arch/h8300/include/asm/termbits.h
@@ -179,6 +179,7 @@ struct ktermios {
179#define FLUSHO 0010000 179#define FLUSHO 0010000
180#define PENDIN 0040000 180#define PENDIN 0040000
181#define IEXTEN 0100000 181#define IEXTEN 0100000
182#define EXTPROC 0200000
182 183
183 184
184/* tcflow() and TCXONC use these */ 185/* tcflow() and TCXONC use these */
diff --git a/arch/ia64/include/asm/ioctls.h b/arch/ia64/include/asm/ioctls.h
index f0ee86c0b5f7..b79c385114ef 100644
--- a/arch/ia64/include/asm/ioctls.h
+++ b/arch/ia64/include/asm/ioctls.h
@@ -59,6 +59,7 @@
59#define TCSETSF2 _IOW('T',0x2D, struct termios2) 59#define TCSETSF2 _IOW('T',0x2D, struct termios2)
60#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 60#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
61#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 61#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
62#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
62 63
63#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 64#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
64#define FIOCLEX 0x5451 65#define FIOCLEX 0x5451
@@ -85,6 +86,7 @@
85#define TIOCPKT_START 8 86#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16 87#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32 88#define TIOCPKT_DOSTOP 32
89#define TIOCPKT_IOCTL 64
88 90
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 91#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90 92
diff --git a/arch/ia64/include/asm/termbits.h b/arch/ia64/include/asm/termbits.h
index 9f162e0089ad..c009b94e58d9 100644
--- a/arch/ia64/include/asm/termbits.h
+++ b/arch/ia64/include/asm/termbits.h
@@ -187,6 +187,7 @@ struct ktermios {
187#define FLUSHO 0010000 187#define FLUSHO 0010000
188#define PENDIN 0040000 188#define PENDIN 0040000
189#define IEXTEN 0100000 189#define IEXTEN 0100000
190#define EXTPROC 0200000
190 191
191/* tcflow() and TCXONC use these */ 192/* tcflow() and TCXONC use these */
192#define TCOOFF 0 193#define TCOOFF 0
diff --git a/arch/m32r/include/asm/ioctls.h b/arch/m32r/include/asm/ioctls.h
index f4c13a52fe48..66288063a4c0 100644
--- a/arch/m32r/include/asm/ioctls.h
+++ b/arch/m32r/include/asm/ioctls.h
@@ -53,6 +53,7 @@
53#define TCSETSF2 _IOW('T',0x2D, struct termios2) 53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
56 57
57#define FIONCLEX 0x5450 58#define FIONCLEX 0x5450
58#define FIOCLEX 0x5451 59#define FIOCLEX 0x5451
@@ -79,6 +80,7 @@
79#define TIOCPKT_START 8 80#define TIOCPKT_START 8
80#define TIOCPKT_NOSTOP 16 81#define TIOCPKT_NOSTOP 16
81#define TIOCPKT_DOSTOP 32 82#define TIOCPKT_DOSTOP 32
83#define TIOCPKT_IOCTL 64
82 84
83#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
84 86
diff --git a/arch/m32r/include/asm/termbits.h b/arch/m32r/include/asm/termbits.h
index bc104008b55b..957a3c688549 100644
--- a/arch/m32r/include/asm/termbits.h
+++ b/arch/m32r/include/asm/termbits.h
@@ -179,6 +179,7 @@ struct ktermios {
179#define FLUSHO 0010000 179#define FLUSHO 0010000
180#define PENDIN 0040000 180#define PENDIN 0040000
181#define IEXTEN 0100000 181#define IEXTEN 0100000
182#define EXTPROC 0200000
182 183
183/* tcflow() and TCXONC use these */ 184/* tcflow() and TCXONC use these */
184#define TCOOFF 0 185#define TCOOFF 0
diff --git a/arch/m68k/include/asm/ioctls.h b/arch/m68k/include/asm/ioctls.h
index b8d2f4be7fd7..91a57d665460 100644
--- a/arch/m68k/include/asm/ioctls.h
+++ b/arch/m68k/include/asm/ioctls.h
@@ -52,6 +52,7 @@
52#define TCSETSF2 _IOW('T',0x2D, struct termios2) 52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
55#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
55 56
56#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 57#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
57#define FIOCLEX 0x5451 58#define FIOCLEX 0x5451
@@ -78,6 +79,7 @@
78#define TIOCPKT_START 8 79#define TIOCPKT_START 8
79#define TIOCPKT_NOSTOP 16 80#define TIOCPKT_NOSTOP 16
80#define TIOCPKT_DOSTOP 32 81#define TIOCPKT_DOSTOP 32
82#define TIOCPKT_IOCTL 64
81 83
82#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 84#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
83 85
diff --git a/arch/m68k/include/asm/termbits.h b/arch/m68k/include/asm/termbits.h
index 8c14170996bb..aea1e37b765a 100644
--- a/arch/m68k/include/asm/termbits.h
+++ b/arch/m68k/include/asm/termbits.h
@@ -179,6 +179,7 @@ struct ktermios {
179#define FLUSHO 0010000 179#define FLUSHO 0010000
180#define PENDIN 0040000 180#define PENDIN 0040000
181#define IEXTEN 0100000 181#define IEXTEN 0100000
182#define EXTPROC 0200000
182 183
183 184
184/* tcflow() and TCXONC use these */ 185/* tcflow() and TCXONC use these */
diff --git a/arch/mips/include/asm/ioctls.h b/arch/mips/include/asm/ioctls.h
index 2fb9e1693bf7..d87cb0465693 100644
--- a/arch/mips/include/asm/ioctls.h
+++ b/arch/mips/include/asm/ioctls.h
@@ -41,7 +41,7 @@
41#define TIOCPKT_START 0x08 /* start output */ 41#define TIOCPKT_START 0x08 /* start output */
42#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ 42#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
43#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ 43#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
44/* #define TIOCPKT_IOCTL 0x40 state change of pty driver */ 44#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
45#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ 45#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
46#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ 46#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
47#define TIOCNOTTY 0x5471 /* void tty association */ 47#define TIOCNOTTY 0x5471 /* void tty association */
@@ -83,6 +83,7 @@
83#define TCSETSF2 _IOW('T', 0x2D, struct termios2) 83#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
84#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 84#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
85#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ 85#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
86#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
86 87
87/* I hope the range from 0x5480 on is free ... */ 88/* I hope the range from 0x5480 on is free ... */
88#define TIOCSCTTY 0x5480 /* become controlling tty */ 89#define TIOCSCTTY 0x5480 /* become controlling tty */
diff --git a/arch/mips/include/asm/termbits.h b/arch/mips/include/asm/termbits.h
index c83c68444e86..76630b396fac 100644
--- a/arch/mips/include/asm/termbits.h
+++ b/arch/mips/include/asm/termbits.h
@@ -203,6 +203,7 @@ struct ktermios {
203#define PENDIN 0040000 /* Retype pending input (state). */ 203#define PENDIN 0040000 /* Retype pending input (state). */
204#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ 204#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
205#define ITOSTOP TOSTOP 205#define ITOSTOP TOSTOP
206#define EXTPROC 0200000 /* External processing on pty */
206 207
207/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 208/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
208#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 209#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
diff --git a/arch/mn10300/include/asm/ioctls.h b/arch/mn10300/include/asm/ioctls.h
index 638219a99b1e..cb8cf1902234 100644
--- a/arch/mn10300/include/asm/ioctls.h
+++ b/arch/mn10300/include/asm/ioctls.h
@@ -54,6 +54,7 @@
54#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number 54#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number
55 * (of pty-mux device) */ 55 * (of pty-mux device) */
56#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ 56#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
57#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
57 58
58#define FIONCLEX 0x5450 59#define FIONCLEX 0x5450
59#define FIOCLEX 0x5451 60#define FIOCLEX 0x5451
@@ -80,6 +81,7 @@
80#define TIOCPKT_START 8 81#define TIOCPKT_START 8
81#define TIOCPKT_NOSTOP 16 82#define TIOCPKT_NOSTOP 16
82#define TIOCPKT_DOSTOP 32 83#define TIOCPKT_DOSTOP 32
84#define TIOCPKT_IOCTL 64
83 85
84#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 86#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
85 87
diff --git a/arch/mn10300/include/asm/termbits.h b/arch/mn10300/include/asm/termbits.h
index eb2b0dc1f696..130d42495972 100644
--- a/arch/mn10300/include/asm/termbits.h
+++ b/arch/mn10300/include/asm/termbits.h
@@ -180,6 +180,7 @@ struct ktermios {
180#define FLUSHO 0010000 180#define FLUSHO 0010000
181#define PENDIN 0040000 181#define PENDIN 0040000
182#define IEXTEN 0100000 182#define IEXTEN 0100000
183#define EXTPROC 0200000
183 184
184/* tcflow() and TCXONC use these */ 185/* tcflow() and TCXONC use these */
185#define TCOOFF 0 186#define TCOOFF 0
diff --git a/arch/parisc/include/asm/ioctls.h b/arch/parisc/include/asm/ioctls.h
index 6cc497e52532..4e0614456bea 100644
--- a/arch/parisc/include/asm/ioctls.h
+++ b/arch/parisc/include/asm/ioctls.h
@@ -52,6 +52,7 @@
52#define TCSETSF2 _IOW('T',0x2D, struct termios2) 52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
55#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
55 56
56#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 57#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
57#define FIOCLEX 0x5451 58#define FIOCLEX 0x5451
@@ -82,6 +83,7 @@
82#define TIOCPKT_START 8 83#define TIOCPKT_START 8
83#define TIOCPKT_NOSTOP 16 84#define TIOCPKT_NOSTOP 16
84#define TIOCPKT_DOSTOP 32 85#define TIOCPKT_DOSTOP 32
86#define TIOCPKT_IOCTL 64
85 87
86#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 88#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
87 89
diff --git a/arch/parisc/include/asm/termbits.h b/arch/parisc/include/asm/termbits.h
index d8bbc73b16b7..d1ab92177a5c 100644
--- a/arch/parisc/include/asm/termbits.h
+++ b/arch/parisc/include/asm/termbits.h
@@ -180,6 +180,7 @@ struct ktermios {
180#define FLUSHO 0010000 180#define FLUSHO 0010000
181#define PENDIN 0040000 181#define PENDIN 0040000
182#define IEXTEN 0100000 182#define IEXTEN 0100000
183#define EXTPROC 0200000
183 184
184/* tcflow() and TCXONC use these */ 185/* tcflow() and TCXONC use these */
185#define TCOOFF 0 186#define TCOOFF 0
diff --git a/arch/powerpc/include/asm/ioctls.h b/arch/powerpc/include/asm/ioctls.h
index 1842186d872c..851920052e08 100644
--- a/arch/powerpc/include/asm/ioctls.h
+++ b/arch/powerpc/include/asm/ioctls.h
@@ -80,6 +80,7 @@
80# define TIOCPKT_START 8 80# define TIOCPKT_START 8
81# define TIOCPKT_NOSTOP 16 81# define TIOCPKT_NOSTOP 16
82# define TIOCPKT_DOSTOP 32 82# define TIOCPKT_DOSTOP 32
83# define TIOCPKT_IOCTL 64
83 84
84 85
85#define TIOCNOTTY 0x5422 86#define TIOCNOTTY 0x5422
@@ -93,6 +94,7 @@
93#define TIOCSRS485 0x542f 94#define TIOCSRS485 0x542f
94#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 95#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
95#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 96#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
97#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
96 98
97#define TIOCSERCONFIG 0x5453 99#define TIOCSERCONFIG 0x5453
98#define TIOCSERGWILD 0x5454 100#define TIOCSERGWILD 0x5454
diff --git a/arch/powerpc/include/asm/termbits.h b/arch/powerpc/include/asm/termbits.h
index 6698188ca550..549d700e18f2 100644
--- a/arch/powerpc/include/asm/termbits.h
+++ b/arch/powerpc/include/asm/termbits.h
@@ -189,6 +189,7 @@ struct ktermios {
189#define FLUSHO 0x00800000 189#define FLUSHO 0x00800000
190#define PENDIN 0x20000000 190#define PENDIN 0x20000000
191#define IEXTEN 0x00000400 191#define IEXTEN 0x00000400
192#define EXTPROC 0x10000000
192 193
193/* Values for the ACTION argument to `tcflow'. */ 194/* Values for the ACTION argument to `tcflow'. */
194#define TCOOFF 0 195#define TCOOFF 0
diff --git a/arch/s390/include/asm/ioctls.h b/arch/s390/include/asm/ioctls.h
index 40e481b1b461..2f3d8736361f 100644
--- a/arch/s390/include/asm/ioctls.h
+++ b/arch/s390/include/asm/ioctls.h
@@ -60,6 +60,7 @@
60#define TCSETSF2 _IOW('T',0x2D, struct termios2) 60#define TCSETSF2 _IOW('T',0x2D, struct termios2)
61#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 61#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
62#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 62#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
63#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
63 64
64#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 65#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
65#define FIOCLEX 0x5451 66#define FIOCLEX 0x5451
@@ -86,6 +87,7 @@
86#define TIOCPKT_START 8 87#define TIOCPKT_START 8
87#define TIOCPKT_NOSTOP 16 88#define TIOCPKT_NOSTOP 16
88#define TIOCPKT_DOSTOP 32 89#define TIOCPKT_DOSTOP 32
90#define TIOCPKT_IOCTL 64
89 91
90#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 92#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
91 93
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/asm/ioctls.h
index c212c371a4a5..eb6c4c687972 100644
--- a/arch/sh/include/asm/ioctls.h
+++ b/arch/sh/include/asm/ioctls.h
@@ -69,6 +69,7 @@
69# define TIOCPKT_START 8 69# define TIOCPKT_START 8
70# define TIOCPKT_NOSTOP 16 70# define TIOCPKT_NOSTOP 16
71# define TIOCPKT_DOSTOP 32 71# define TIOCPKT_DOSTOP 32
72# define TIOCPKT_IOCTL 64
72 73
73 74
74#define TIOCNOTTY _IO('T', 34) /* 0x5422 */ 75#define TIOCNOTTY _IO('T', 34) /* 0x5422 */
@@ -84,6 +85,7 @@
84#define TCSETSF2 _IOW('T', 45, struct termios2) 85#define TCSETSF2 _IOW('T', 45, struct termios2)
85#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 86#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
86#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 87#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
88#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
87 89
88#define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ 90#define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */
89#define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ 91#define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */
diff --git a/arch/sparc/include/asm/ioctls.h b/arch/sparc/include/asm/ioctls.h
index 1fe6855c5c18..53f4ee009bdd 100644
--- a/arch/sparc/include/asm/ioctls.h
+++ b/arch/sparc/include/asm/ioctls.h
@@ -80,6 +80,7 @@
80/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */ 80/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
81#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */ 81#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
82#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */ 82#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
83#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
83 84
84/* Little f */ 85/* Little f */
85#define FIOCLEX _IO('f', 1) 86#define FIOCLEX _IO('f', 1)
@@ -132,5 +133,6 @@
132#define TIOCPKT_START 8 133#define TIOCPKT_START 8
133#define TIOCPKT_NOSTOP 16 134#define TIOCPKT_NOSTOP 16
134#define TIOCPKT_DOSTOP 32 135#define TIOCPKT_DOSTOP 32
136#define TIOCPKT_IOCTL 64
135 137
136#endif /* !(_ASM_SPARC_IOCTLS_H) */ 138#endif /* !(_ASM_SPARC_IOCTLS_H) */
diff --git a/arch/sparc/include/asm/termbits.h b/arch/sparc/include/asm/termbits.h
index d72dfed1f9d7..23b10ff08df2 100644
--- a/arch/sparc/include/asm/termbits.h
+++ b/arch/sparc/include/asm/termbits.h
@@ -225,6 +225,7 @@ struct ktermios {
225#define FLUSHO 0x00002000 225#define FLUSHO 0x00002000
226#define PENDIN 0x00004000 226#define PENDIN 0x00004000
227#define IEXTEN 0x00008000 227#define IEXTEN 0x00008000
228#define EXTPROC 0x00010000
228 229
229/* modem lines */ 230/* modem lines */
230#define TIOCM_LE 0x001 231#define TIOCM_LE 0x001
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/asm/ioctls.h
index 0ffa942954b9..ab1800012ed9 100644
--- a/arch/xtensa/include/asm/ioctls.h
+++ b/arch/xtensa/include/asm/ioctls.h
@@ -81,6 +81,7 @@
81# define TIOCPKT_START 8 81# define TIOCPKT_START 8
82# define TIOCPKT_NOSTOP 16 82# define TIOCPKT_NOSTOP 16
83# define TIOCPKT_DOSTOP 32 83# define TIOCPKT_DOSTOP 32
84# define TIOCPKT_IOCTL 64
84 85
85 86
86#define TIOCNOTTY _IO('T', 34) 87#define TIOCNOTTY _IO('T', 34)
@@ -97,6 +98,7 @@
97#define TCSETSF2 _IOW('T', 45, struct termios2) 98#define TCSETSF2 _IOW('T', 45, struct termios2)
98#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 99#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
99#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 100#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
101#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
100 102
101#define TIOCSERCONFIG _IO('T', 83) 103#define TIOCSERCONFIG _IO('T', 83)
102#define TIOCSERGWILD _IOR('T', 84, int) 104#define TIOCSERGWILD _IOR('T', 84, int)
diff --git a/arch/xtensa/include/asm/termbits.h b/arch/xtensa/include/asm/termbits.h
index 85aa6a3c0b6e..0d6c8715b24f 100644
--- a/arch/xtensa/include/asm/termbits.h
+++ b/arch/xtensa/include/asm/termbits.h
@@ -196,6 +196,7 @@ struct ktermios {
196#define FLUSHO 0010000 196#define FLUSHO 0010000
197#define PENDIN 0040000 197#define PENDIN 0040000
198#define IEXTEN 0100000 198#define IEXTEN 0100000
199#define EXTPROC 0200000
199 200
200/* tcflow() and TCXONC use these */ 201/* tcflow() and TCXONC use these */
201 202
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index bdae8327143c..428f4fe0b5f7 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1102,6 +1102,11 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
1102 if (I_IUCLC(tty) && L_IEXTEN(tty)) 1102 if (I_IUCLC(tty) && L_IEXTEN(tty))
1103 c = tolower(c); 1103 c = tolower(c);
1104 1104
1105 if (L_EXTPROC(tty)) {
1106 put_tty_queue(c, tty);
1107 return;
1108 }
1109
1105 if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && 1110 if (tty->stopped && !tty->flow_stopped && I_IXON(tty) &&
1106 I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty) && 1111 I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty) &&
1107 c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && c != SUSP_CHAR(tty)) { 1112 c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && c != SUSP_CHAR(tty)) {
@@ -1409,7 +1414,8 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
1409 1414
1410 n_tty_set_room(tty); 1415 n_tty_set_room(tty);
1411 1416
1412 if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) { 1417 if ((!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) ||
1418 L_EXTPROC(tty)) {
1413 kill_fasync(&tty->fasync, SIGIO, POLL_IN); 1419 kill_fasync(&tty->fasync, SIGIO, POLL_IN);
1414 if (waitqueue_active(&tty->read_wait)) 1420 if (waitqueue_active(&tty->read_wait))
1415 wake_up_interruptible(&tty->read_wait); 1421 wake_up_interruptible(&tty->read_wait);
@@ -1585,7 +1591,7 @@ static int n_tty_open(struct tty_struct *tty)
1585static inline int input_available_p(struct tty_struct *tty, int amt) 1591static inline int input_available_p(struct tty_struct *tty, int amt)
1586{ 1592{
1587 tty_flush_to_ldisc(tty); 1593 tty_flush_to_ldisc(tty);
1588 if (tty->icanon) { 1594 if (tty->icanon && !L_EXTPROC(tty)) {
1589 if (tty->canon_data) 1595 if (tty->canon_data)
1590 return 1; 1596 return 1;
1591 } else if (tty->read_cnt >= (amt ? amt : 1)) 1597 } else if (tty->read_cnt >= (amt ? amt : 1))
@@ -1632,6 +1638,11 @@ static int copy_from_read_buf(struct tty_struct *tty,
1632 spin_lock_irqsave(&tty->read_lock, flags); 1638 spin_lock_irqsave(&tty->read_lock, flags);
1633 tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); 1639 tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);
1634 tty->read_cnt -= n; 1640 tty->read_cnt -= n;
1641 /* Turn single EOF into zero-length read */
1642 if (L_EXTPROC(tty) && tty->icanon && n == 1) {
1643 if (!tty->read_cnt && (*b)[n-1] == EOF_CHAR(tty))
1644 n--;
1645 }
1635 spin_unlock_irqrestore(&tty->read_lock, flags); 1646 spin_unlock_irqrestore(&tty->read_lock, flags);
1636 *b += n; 1647 *b += n;
1637 *nr -= n; 1648 *nr -= n;
@@ -1812,7 +1823,7 @@ do_it_again:
1812 nr--; 1823 nr--;
1813 } 1824 }
1814 1825
1815 if (tty->icanon) { 1826 if (tty->icanon && !L_EXTPROC(tty)) {
1816 /* N.B. avoid overrun if nr == 0 */ 1827 /* N.B. avoid overrun if nr == 0 */
1817 while (nr && tty->read_cnt) { 1828 while (nr && tty->read_cnt) {
1818 int eol; 1829 int eol;
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index d83a43130df4..b640ef29be1c 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -171,6 +171,23 @@ static int pty_set_lock(struct tty_struct *tty, int __user *arg)
171 return 0; 171 return 0;
172} 172}
173 173
174/* Send a signal to the slave */
175static int pty_signal(struct tty_struct *tty, int sig)
176{
177 unsigned long flags;
178 struct pid *pgrp;
179
180 if (tty->link) {
181 spin_lock_irqsave(&tty->link->ctrl_lock, flags);
182 pgrp = get_pid(tty->link->pgrp);
183 spin_unlock_irqrestore(&tty->link->ctrl_lock, flags);
184
185 kill_pgrp(pgrp, sig, 1);
186 put_pid(pgrp);
187 }
188 return 0;
189}
190
174static void pty_flush_buffer(struct tty_struct *tty) 191static void pty_flush_buffer(struct tty_struct *tty)
175{ 192{
176 struct tty_struct *to = tty->link; 193 struct tty_struct *to = tty->link;
@@ -321,6 +338,8 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
321 switch (cmd) { 338 switch (cmd) {
322 case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */ 339 case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */
323 return pty_set_lock(tty, (int __user *) arg); 340 return pty_set_lock(tty, (int __user *) arg);
341 case TIOCSIG: /* Send signal to other side of pty */
342 return pty_signal(tty, (int) arg);
324 } 343 }
325 return -ENOIOCTLCMD; 344 return -ENOIOCTLCMD;
326} 345}
@@ -476,6 +495,8 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
476 return pty_set_lock(tty, (int __user *)arg); 495 return pty_set_lock(tty, (int __user *)arg);
477 case TIOCGPTN: /* Get PT Number */ 496 case TIOCGPTN: /* Get PT Number */
478 return put_user(tty->index, (unsigned int __user *)arg); 497 return put_user(tty->index, (unsigned int __user *)arg);
498 case TIOCSIG: /* Send signal to other side of pty */
499 return pty_signal(tty, (int) arg);
479 } 500 }
480 501
481 return -ENOIOCTLCMD; 502 return -ENOIOCTLCMD;
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 6bd5f8866c74..0c1889971459 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -517,19 +517,25 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios)
517 517
518 /* See if packet mode change of state. */ 518 /* See if packet mode change of state. */
519 if (tty->link && tty->link->packet) { 519 if (tty->link && tty->link->packet) {
520 int extproc = (old_termios.c_lflag & EXTPROC) |
521 (tty->termios->c_lflag & EXTPROC);
520 int old_flow = ((old_termios.c_iflag & IXON) && 522 int old_flow = ((old_termios.c_iflag & IXON) &&
521 (old_termios.c_cc[VSTOP] == '\023') && 523 (old_termios.c_cc[VSTOP] == '\023') &&
522 (old_termios.c_cc[VSTART] == '\021')); 524 (old_termios.c_cc[VSTART] == '\021'));
523 int new_flow = (I_IXON(tty) && 525 int new_flow = (I_IXON(tty) &&
524 STOP_CHAR(tty) == '\023' && 526 STOP_CHAR(tty) == '\023' &&
525 START_CHAR(tty) == '\021'); 527 START_CHAR(tty) == '\021');
526 if (old_flow != new_flow) { 528 if ((old_flow != new_flow) || extproc) {
527 spin_lock_irqsave(&tty->ctrl_lock, flags); 529 spin_lock_irqsave(&tty->ctrl_lock, flags);
528 tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP); 530 if (old_flow != new_flow) {
529 if (new_flow) 531 tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP);
530 tty->ctrl_status |= TIOCPKT_DOSTOP; 532 if (new_flow)
531 else 533 tty->ctrl_status |= TIOCPKT_DOSTOP;
532 tty->ctrl_status |= TIOCPKT_NOSTOP; 534 else
535 tty->ctrl_status |= TIOCPKT_NOSTOP;
536 }
537 if (extproc)
538 tty->ctrl_status |= TIOCPKT_IOCTL;
533 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 539 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
534 wake_up_interruptible(&tty->link->read_wait); 540 wake_up_interruptible(&tty->link->read_wait);
535 } 541 }
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 63ae85831464..fa4bc48810fd 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -969,6 +969,7 @@ COMPATIBLE_IOCTL(TIOCGPGRP)
969COMPATIBLE_IOCTL(TIOCGPTN) 969COMPATIBLE_IOCTL(TIOCGPTN)
970COMPATIBLE_IOCTL(TIOCSPTLCK) 970COMPATIBLE_IOCTL(TIOCSPTLCK)
971COMPATIBLE_IOCTL(TIOCSERGETLSR) 971COMPATIBLE_IOCTL(TIOCSERGETLSR)
972COMPATIBLE_IOCTL(TIOCSIG)
972#ifdef TCGETS2 973#ifdef TCGETS2
973COMPATIBLE_IOCTL(TCGETS2) 974COMPATIBLE_IOCTL(TCGETS2)
974COMPATIBLE_IOCTL(TCSETS2) 975COMPATIBLE_IOCTL(TCSETS2)
diff --git a/include/asm-generic/ioctls.h b/include/asm-generic/ioctls.h
index 1375fa1a7a4d..8554cb6a81b9 100644
--- a/include/asm-generic/ioctls.h
+++ b/include/asm-generic/ioctls.h
@@ -69,6 +69,7 @@
69#define TCSETX 0x5433 69#define TCSETX 0x5433
70#define TCSETXF 0x5434 70#define TCSETXF 0x5434
71#define TCSETXW 0x5435 71#define TCSETXW 0x5435
72#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
72 73
73#define FIONCLEX 0x5450 74#define FIONCLEX 0x5450
74#define FIOCLEX 0x5451 75#define FIOCLEX 0x5451
@@ -102,6 +103,7 @@
102#define TIOCPKT_START 8 103#define TIOCPKT_START 8
103#define TIOCPKT_NOSTOP 16 104#define TIOCPKT_NOSTOP 16
104#define TIOCPKT_DOSTOP 32 105#define TIOCPKT_DOSTOP 32
106#define TIOCPKT_IOCTL 64
105 107
106#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 108#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
107 109
diff --git a/include/asm-generic/termbits.h b/include/asm-generic/termbits.h
index 1c9773d48cb0..232b4781aef3 100644
--- a/include/asm-generic/termbits.h
+++ b/include/asm-generic/termbits.h
@@ -178,6 +178,7 @@ struct ktermios {
178#define FLUSHO 0010000 178#define FLUSHO 0010000
179#define PENDIN 0040000 179#define PENDIN 0040000
180#define IEXTEN 0100000 180#define IEXTEN 0100000
181#define EXTPROC 0200000
181 182
182/* tcflow() and TCXONC use these */ 183/* tcflow() and TCXONC use these */
183#define TCOOFF 0 184#define TCOOFF 0
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 7802a243ee13..2df60e4ff40e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -179,6 +179,7 @@ struct tty_bufhead {
179#define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO) 179#define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO)
180#define L_PENDIN(tty) _L_FLAG((tty), PENDIN) 180#define L_PENDIN(tty) _L_FLAG((tty), PENDIN)
181#define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN) 181#define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN)
182#define L_EXTPROC(tty) _L_FLAG((tty), EXTPROC)
182 183
183struct device; 184struct device;
184struct signal_struct; 185struct signal_struct;