summaryrefslogtreecommitdiff
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-30 21:41:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-30 21:41:06 +0000
commit116b060cf4dba89b6c66be82029f24526198d4bb (patch)
tree42e0f059b84d8f70c6bacecf27e972373fb77adc /sys/kern/tty_pty.c
parent850508827a6abe22b9653b81bc36aaa3f0df9912 (diff)
fix TIOCGPGRP in sunos emulation
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index bc1b1c8604a..7b37313b565 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.6 1997/11/13 03:11:17 millert Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.7 1997/11/30 21:41:03 deraadt Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -616,6 +616,19 @@ ptyioctl(dev, cmd, data, flag, p)
switch (cmd) {
case TIOCGPGRP:
+#ifdef COMPAT_SUNOS
+ {
+ /*
+ * I'm not sure about SunOS TIOCGPGRP semantics
+ * on PTYs, but it's something like this:
+ */
+ extern struct emul emul_sunos;
+ if (p->p_emul == &emul_sunos && tp->t_pgrp == 0)
+ return (EIO);
+ *(int *)data = tp->t_pgrp->pg_id;
+ return (0);
+ }
+#endif
/*
* We aviod calling ttioctl on the controller since,
* in that case, tp must be the controlling terminal.