Commit | Line | Data |
---|---|---|
231ed58b | 1 | /* tty_tty.c 4.4 81/10/11 */ |
63c57592 BJ |
2 | |
3 | /* | |
964bcfb1 | 4 | * Indirect driver for controlling tty. |
231ed58b BJ |
5 | * |
6 | * THIS IS GARBAGE: MUST SOON BE DONE WITH struct inode * IN PROC TABLE. | |
63c57592 BJ |
7 | */ |
8 | #include "../h/param.h" | |
9 | #include "../h/systm.h" | |
10 | #include "../h/conf.h" | |
11 | #include "../h/dir.h" | |
12 | #include "../h/user.h" | |
13 | #include "../h/tty.h" | |
14 | #include "../h/proc.h" | |
15 | ||
16 | /*ARGSUSED*/ | |
17 | syopen(dev, flag) | |
18 | { | |
19 | ||
4460d508 | 20 | if(u.u_ttyp == NULL || (u.u_procp->p_flag&SDETACH)) { |
63c57592 BJ |
21 | u.u_error = ENXIO; |
22 | return; | |
23 | } | |
24 | (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag); | |
25 | } | |
26 | ||
27 | /*ARGSUSED*/ | |
28 | syread(dev) | |
29 | { | |
30 | ||
4460d508 BJ |
31 | if (u.u_procp->p_flag&SDETACH) { |
32 | u.u_error = ENXIO; | |
33 | return; | |
34 | } | |
63c57592 BJ |
35 | (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd); |
36 | } | |
37 | ||
38 | /*ARGSUSED*/ | |
39 | sywrite(dev) | |
40 | { | |
41 | ||
4460d508 BJ |
42 | if (u.u_procp->p_flag&SDETACH) { |
43 | u.u_error = ENXIO; | |
44 | return; | |
45 | } | |
63c57592 BJ |
46 | (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd); |
47 | } | |
48 | ||
49 | /*ARGSUSED*/ | |
50 | syioctl(dev, cmd, addr, flag) | |
51 | caddr_t addr; | |
52 | { | |
53 | ||
4460d508 BJ |
54 | if (u.u_procp->p_flag&SDETACH) { |
55 | u.u_error = ENXIO; | |
56 | return; | |
57 | } | |
63c57592 BJ |
58 | (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag); |
59 | } | |
231ed58b BJ |
60 | |
61 | syselect(dev, flag) | |
62 | { | |
63 | ||
64 | if (u.u_procp->p_flag&SDETACH) { | |
65 | u.u_error = ENXIO; | |
66 | return; | |
67 | } | |
68 | (*cdevsw[major(u.u_ttyd)].d_select)(dev, flag); | |
69 | } |