From: Edward Wang Date: Mon, 18 Jul 1983 06:19:04 +0000 (-0800) Subject: date and time created 83/07/17 15:19:04 by edward X-Git-Tag: BSD-4_2-Snapshot-Development~780 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/b94626a34cc67bacdbdc82ce25384fe900601160 date and time created 83/07/17 15:19:04 by edward SCCS-vsn: usr.bin/window/wwtty.c 1.1 --- diff --git a/usr/src/usr.bin/window/wwtty.c b/usr/src/usr.bin/window/wwtty.c new file mode 100644 index 0000000000..d7acf8066f --- /dev/null +++ b/usr/src/usr.bin/window/wwtty.c @@ -0,0 +1,41 @@ +#ifndef lint +static char *sccsid = "@(#)wwtty.c 1.1 83/07/17"; +#endif + +#include "ww.h" + +wwgettty(d, t) +register struct ww_tty *t; +{ + if (ioctl(d, TIOCGETP, &t->ww_sgttyb) < 0) + return -1; + if (ioctl(d, TIOCGETC, &t->ww_tchars) < 0) + return -1; + if (ioctl(d, TIOCGLTC, &t->ww_ltchars) < 0) + return -1; + if (ioctl(d, TIOCLGET, &t->ww_lmode) < 0) + return -1; + if (ioctl(d, TIOCGETD, &t->ww_ldisc) < 0) + return -1; + if (ioctl(d, TIOCGPGRP, &t->ww_pgrp) < 0) + return -1; + return 0; +} + +wwsettty(d, t) +register struct ww_tty *t; +{ + if (ioctl(d, TIOCSETP, &t->ww_sgttyb) < 0) + return -1; + if (ioctl(d, TIOCSETC, &t->ww_tchars) < 0) + return -1; + if (ioctl(d, TIOCSLTC, &t->ww_ltchars) < 0) + return -1; + if (ioctl(d, TIOCLSET, &t->ww_lmode) < 0) + return -1; + if (ioctl(d, TIOCSETD, &t->ww_ldisc) < 0) + return -1; + if (ioctl(d, TIOCSPGRP, &t->ww_pgrp) < 0) + return -1; + return 0; +}