date and time created 83/07/17 15:19:04 by edward
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Mon, 18 Jul 1983 06:19:04 +0000 (22:19 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Mon, 18 Jul 1983 06:19:04 +0000 (22:19 -0800)
SCCS-vsn: usr.bin/window/wwtty.c 1.1

usr/src/usr.bin/window/wwtty.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/window/wwtty.c b/usr/src/usr.bin/window/wwtty.c
new file mode 100644 (file)
index 0000000..d7acf80
--- /dev/null
@@ -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;
+}