This source file includes following definitions.
- pty_copy
- mpty_write
- spty_write
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include <linux/tty.h>
16 #include <linux/sched.h>
17 #include <asm/system.h>
18 #include <asm/io.h>
19
20 static inline void pty_copy(struct tty_struct * from, struct tty_struct * to)
21 {
22 char c;
23
24 while (!from->stopped && !EMPTY(from->write_q)) {
25 if (FULL(to->read_q)) {
26 if (FULL(to->secondary))
27 break;
28 TTY_READ_FLUSH(to);
29 continue;
30 }
31 GETCH(from->write_q,c);
32 PUTCH(c,to->read_q);
33 if (current->signal & ~current->blocked)
34 break;
35 }
36 TTY_READ_FLUSH(to);
37 wake_up(&from->write_q->proc_list);
38 }
39
40
41
42
43
44
45 void mpty_write(struct tty_struct * tty)
46 {
47 int nr = tty - tty_table;
48
49 if ((nr >> 6) != 2)
50 printk("bad mpty\n\r");
51 else
52 pty_copy(tty,tty+64);
53 }
54
55 void spty_write(struct tty_struct * tty)
56 {
57 int nr = tty - tty_table;
58
59 if ((nr >> 6) != 3)
60 printk("bad spty\n\r");
61 else
62 pty_copy(tty,tty-64);
63 }