summaryrefslogtreecommitdiff
path: root/sys/compat/sunos/sunos_ioctl.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/compat/sunos/sunos_ioctl.c
parent850508827a6abe22b9653b81bc36aaa3f0df9912 (diff)
fix TIOCGPGRP in sunos emulation
Diffstat (limited to 'sys/compat/sunos/sunos_ioctl.c')
-rw-r--r--sys/compat/sunos/sunos_ioctl.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c
index c3f775191ef..e52a1d3066e 100644
--- a/sys/compat/sunos/sunos_ioctl.c
+++ b/sys/compat/sunos/sunos_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunos_ioctl.c,v 1.4 1996/04/18 21:21:44 niklas Exp $ */
+/* $OpenBSD: sunos_ioctl.c,v 1.5 1997/11/30 21:41:05 deraadt Exp $ */
/* $NetBSD: sunos_ioctl.c,v 1.23 1996/03/14 19:33:46 christos Exp $ */
/*
@@ -476,12 +476,27 @@ sunos_sys_ioctl(p, v, retval)
return copyout ((caddr_t)&ss, SCARG(uap, data), sizeof (ss));
}
- case _IOW('t', 130, int):
+ case _IOW('t', 130, int): /* TIOCSETPGRP: posix variant */
SCARG(uap, com) = TIOCSPGRP;
break;
case _IOR('t', 131, int):
- SCARG(uap, com) = TIOCGPGRP;
- break;
+ {
+ /*
+ * sigh, must do error translation on pty devices
+ * (see also kern/tty_pty.c)
+ */
+ int pgrp;
+ struct vnode *vp;
+ error = (*ctl)(fp, TIOCGPGRP, (caddr_t)&pgrp, p);
+ if (error) {
+ vp = (struct vnode *)fp->f_data;
+ if (error == EIO && vp != NULL &&
+ vp->v_type == VCHR && major(vp->v_rdev) == 21)
+ error = ENOTTY;
+ return (error);
+ }
+ return copyout((caddr_t)&pgrp, SCARG(uap, data), sizeof(pgrp));
+ }
case _IO('t', 132):
SCARG(uap, com) = TIOCSCTTY;
break;