summaryrefslogtreecommitdiff
path: root/sys/compat/svr4/svr4_ttold.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-08-01 00:50:57 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-08-01 00:50:57 +0000
commita82c8140c72f0f55d9967dc458496992fce2292f (patch)
tree387a5aa34c61ef778d9a1b49b596ea6b459cb2b3 /sys/compat/svr4/svr4_ttold.c
parent6edefdb68777d682eb395900b8905a95bd3cac7d (diff)
Merge of NetBSD 0722
Diffstat (limited to 'sys/compat/svr4/svr4_ttold.c')
-rw-r--r--sys/compat/svr4/svr4_ttold.c100
1 files changed, 93 insertions, 7 deletions
diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c
index e10c94909f6..78170a53239 100644
--- a/sys/compat/svr4/svr4_ttold.c
+++ b/sys/compat/svr4/svr4_ttold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_ttold.c,v 1.4 1996/04/21 22:18:40 deraadt Exp $ */
+/* $OpenBSD: svr4_ttold.c,v 1.5 1996/08/01 00:50:56 niklas Exp $ */
/* $NetBSD: svr4_ttold.c,v 1.9 1996/04/11 12:54:45 christos Exp $ */
/*
@@ -65,6 +65,42 @@ static void svr4_ltchars_to_bsd_ltchars __P((const struct svr4_ltchars *sl,
static void bsd_ltchars_to_svr4_ltchars __P((const struct ltchars *bl,
struct svr4_ltchars *sl));
+#ifdef DEBUG_SVR4
+static void print_svr4_sgttyb __P((const char *, struct svr4_sgttyb *));
+static void print_svr4_tchars __P((const char *, struct svr4_tchars *));
+static void print_svr4_ltchars __P((const char *, struct svr4_ltchars *));
+
+static void
+print_svr4_sgttyb(str, ss)
+ const char *str;
+ struct svr4_sgttyb *ss;
+{
+ uprintf("%s\nispeed=%o ospeed=%o ", str, ss->sg_ispeed, ss->sg_ospeed);
+ uprintf("erase=%o kill=%o flags=%o\n", ss->sg_erase, ss->sg_kill,
+ ss->sg_flags);
+}
+
+static void
+print_svr4_tchars(str, st)
+ const char *str;
+ struct svr4_tchars *st;
+{
+ uprintf("%s\nintrc=%o quitc=%o ", str, st->t_intrc, st->t_quitc);
+ uprintf("startc=%o stopc=%o eofc=%o brkc=%o\n", st->t_startc,
+ st->t_stopc, st->t_eofc, st->t_brkc);
+}
+
+static void
+print_svr4_ltchars(str, sl)
+ const char *str;
+ struct svr4_ltchars *sl;
+{
+ uprintf("%s\nsuspc=%o dsuspc=%o ", str, sl->t_suspc, sl->t_dsuspc);
+ uprintf("rprntc=%o flushc=%o werasc=%o lnextc=%o\n", sl->t_rprntc,
+ sl->t_flushc, sl->t_werasc, sl->t_lnextc);
+}
+#endif /* DEBUG_SVR4 */
+
static void
svr4_tchars_to_bsd_tchars(st, bt)
const struct svr4_tchars *st;
@@ -171,7 +207,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
(caddr_t) &pid, p)) != 0)
return error;
- DPRINTF(("TIOCGPGRP %d", pid));
+ DPRINTF(("TIOCGPGRP %d\n", pid));
if ((error = copyout(&pid, data, sizeof(pid))) != 0)
return error;
@@ -185,7 +221,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
if ((error = copyin(data, &pid, sizeof(pid))) != 0)
return error;
- DPRINTF(("TIOCSPGRP %d", pid));
+ DPRINTF(("TIOCSPGRP %d\n", pid));
return (*ctl)(fp, TIOCSPGRP, (caddr_t) &pid, p);
}
@@ -198,7 +234,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
(caddr_t) &pid, p)) != 0)
return error;
- DPRINTF(("TIOCGSID %d", pid));
+ DPRINTF(("TIOCGSID %d\n", pid));
return copyout(&pid, data, sizeof(pid));
}
@@ -213,6 +249,9 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
bsd_sgttyb_to_svr4_sgttyb(&bs, &ss);
+#ifdef DEBUG_SVR4
+ print_svr4_sgttyb("SVR4_TIOCGETP", &ss);
+#endif /* DEBUG_SVR4 */
return copyout(&ss, data, sizeof(ss));
}
@@ -226,7 +265,9 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
svr4_sgttyb_to_bsd_sgttyb(&ss, &bs);
-
+#ifdef DEBUG_SVR4
+ print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss);
+#endif /* DEBUG_SVR4 */
cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN;
return (*ctl)(fp, cmd, (caddr_t) &bs, p);
}
@@ -241,6 +282,9 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
bsd_tchars_to_svr4_tchars(&bt, &st);
+#ifdef DEBUG_SVR4
+ print_svr4_tchars("SVR4_TIOCGETC", &st);
+#endif /* DEBUG_SVR4 */
return copyout(&st, data, sizeof(st));
}
@@ -253,7 +297,9 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
svr4_tchars_to_bsd_tchars(&st, &bt);
-
+#ifdef DEBUG_SVR4
+ print_svr4_tchars("SVR4_TIOCSETC", &st);
+#endif /* DEBUG_SVR4 */
return (*ctl)(fp, TIOCSETC, (caddr_t) &bt, p);
}
@@ -267,6 +313,9 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
bsd_ltchars_to_svr4_ltchars(&bl, &sl);
+#ifdef DEBUG_SVR4
+ print_svr4_ltchars("SVR4_TIOCGLTC", &sl);
+#endif /* DEBUG_SVR4 */
return copyout(&sl, data, sizeof(sl));
}
@@ -279,10 +328,47 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
return error;
svr4_ltchars_to_bsd_ltchars(&sl, &bl);
-
+#ifdef DEBUG_SVR4
+ print_svr4_ltchars("SVR4_TIOCSLTC", &sl);
+#endif /* DEBUG_SVR4 */
return (*ctl)(fp, TIOCSLTC, (caddr_t) &bl, p);
}
+ case SVR4_TIOCLGET:
+ {
+ int flags;
+ if ((error = (*ctl)(fp, cmd, (caddr_t) &flags, p)) !=
+ 0)
+ return error;
+ DPRINTF(("SVR4_TIOCLGET %o\n", flags));
+ return copyout(&flags, data, sizeof(flags));
+ }
+
+ case SVR4_TIOCLSET:
+ case SVR4_TIOCLBIS:
+ case SVR4_TIOCLBIC:
+ {
+ int flags;
+
+ if ((error = copyin(data, &flags, sizeof(flags))) != 0)
+ return error;
+
+ switch (cmd) {
+ case SVR4_TIOCLSET:
+ cmd = TIOCLSET;
+ break;
+ case SVR4_TIOCLBIS:
+ cmd = TIOCLBIS;
+ break;
+ case SVR4_TIOCLBIC:
+ cmd = TIOCLBIC;
+ break;
+ }
+
+ DPRINTF(("SVR4_TIOCL{SET,BIS,BIC} %o\n", flags));
+ return (*ctl)(fp, cmd, (caddr_t) &flags, p);
+ }
+
default:
DPRINTF(("Unknown svr4 ttold %lx\n", cmd));
return 0; /* ENOSYS really */