Commit | Line | Data |
---|---|---|
b94626a3 | 1 | #ifndef lint |
91f10fe7 | 2 | static char *sccsid = "@(#)wwtty.c 3.2 83/08/12"; |
b94626a3 EW |
3 | #endif |
4 | ||
5 | #include "ww.h" | |
6 | ||
7 | wwgettty(d, t) | |
8 | register struct ww_tty *t; | |
9 | { | |
91f10fe7 | 10 | if (ioctl(d, (int)TIOCGETP, (char *)&t->ww_sgttyb) < 0) |
b94626a3 | 11 | return -1; |
91f10fe7 | 12 | if (ioctl(d, (int)TIOCGETC, (char *)&t->ww_tchars) < 0) |
b94626a3 | 13 | return -1; |
91f10fe7 | 14 | if (ioctl(d, (int)TIOCGLTC, (char *)&t->ww_ltchars) < 0) |
b94626a3 | 15 | return -1; |
91f10fe7 | 16 | if (ioctl(d, (int)TIOCLGET, (char *)&t->ww_lmode) < 0) |
b94626a3 | 17 | return -1; |
91f10fe7 | 18 | if (ioctl(d, (int)TIOCGETD, (char *)&t->ww_ldisc) < 0) |
b94626a3 | 19 | return -1; |
91f10fe7 | 20 | if (ioctl(d, (int)TIOCGPGRP, (char *)&t->ww_pgrp) < 0) |
b94626a3 EW |
21 | return -1; |
22 | return 0; | |
23 | } | |
24 | ||
25 | wwsettty(d, t) | |
26 | register struct ww_tty *t; | |
27 | { | |
91f10fe7 | 28 | if (ioctl(d, (int)TIOCSETP, (char *)&t->ww_sgttyb) < 0) |
b94626a3 | 29 | return -1; |
91f10fe7 | 30 | if (ioctl(d, (int)TIOCSETC, (char *)&t->ww_tchars) < 0) |
b94626a3 | 31 | return -1; |
91f10fe7 | 32 | if (ioctl(d, (int)TIOCSLTC, (char *)&t->ww_ltchars) < 0) |
b94626a3 | 33 | return -1; |
91f10fe7 | 34 | if (ioctl(d, (int)TIOCLSET, (char *)&t->ww_lmode) < 0) |
b94626a3 | 35 | return -1; |
91f10fe7 | 36 | if (ioctl(d, (int)TIOCSETD, (char *)&t->ww_ldisc) < 0) |
b94626a3 | 37 | return -1; |
91f10fe7 | 38 | if (ioctl(d, (int)TIOCSPGRP, (char *)&t->ww_pgrp) < 0) |
b94626a3 EW |
39 | return -1; |
40 | return 0; | |
41 | } |