diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-18 00:12:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-18 00:12:05 +0000 |
commit | 34e48f93086fc4799c5448f1ce7eadc860e04360 (patch) | |
tree | ec9fdf3c70a0b6342dd94937a263a10f3468b770 | |
parent | f6a17bf360416ac496a7450da97334fddd8be6c7 (diff) |
TIOCM{GET,SET,BIS,BIC}, and TCXONC support
-rw-r--r-- | sys/compat/linux/linux_termios.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_termios.c b/sys/compat/linux/linux_termios.c index 61bb9d13282..0867d932175 100644 --- a/sys/compat/linux/linux_termios.c +++ b/sys/compat/linux/linux_termios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_termios.c,v 1.5 1997/12/10 13:35:53 provos Exp $ */ +/* $OpenBSD: linux_termios.c,v 1.6 1999/07/18 00:12:04 deraadt Exp $ */ /* $NetBSD: linux_termios.c,v 1.3 1996/04/05 00:01:54 christos Exp $ */ /* @@ -453,6 +453,7 @@ linux_ioctl_termios(p, uap, retval) struct linux_termio tmplt; struct linux_termios tmplts; struct termios tmpbts; + caddr_t sg; int idat; struct sys_ioctl_args ia; int error; @@ -602,6 +603,18 @@ linux_ioctl_termios(p, uap, retval) case LINUX_TIOCSWINSZ: SCARG(&ia, com) = TIOCSWINSZ; break; + case LINUX_TIOCMGET: + SCARG(&ia, com) = TIOCMGET; + break; + case LINUX_TIOCMBIS: + SCARG(&ia, com) = TIOCMBIS; + break; + case LINUX_TIOCMBIC: + SCARG(&ia, com) = TIOCMBIC; + break; + case LINUX_TIOCMSET: + SCARG(&ia, com) = TIOCMSET; + break; case LINUX_TIOCGPGRP: SCARG(&ia, com) = TIOCGPGRP; break; @@ -632,6 +645,45 @@ linux_ioctl_termios(p, uap, retval) case LINUX_TIOCNOTTY: SCARG(&ia, com) = TIOCNOTTY; break; + case LINUX_TCXONC: + switch ((int)SCARG(uap, data)) { + case LINUX_TCOOFF: + SCARG(&ia, com) = TIOCSTOP; + break; + case LINUX_TCOON: + SCARG(&ia, com) = TIOCSTART; + break; + case LINUX_TCIOFF: + case LINUX_TCION: { + u_char c, *cp; + struct sys_write_args wa; + + error = (*fp->f_ops->fo_ioctl)(fp, TIOCGETA, + (caddr_t)&tmpbts, p); + if (error) + return error; + if ((int)SCARG(uap, data) == LINUX_TCIOFF) + c = tmpbts.c_cc[VSTOP]; + else + c = tmpbts.c_cc[VSTART]; + if (c == _POSIX_VDISABLE) + return 0; + + sg = stackgap_init(p->p_emul); + cp = (char *) stackgap_alloc(&sg, 1); + if ((error = copyout(&c, cp, 1))) + return error; + + SCARG(&wa, fd) = SCARG(uap, fd); + SCARG(&wa, buf) = cp; + SCARG(&wa, nbyte) = 1; + return sys_write(p, &wa, retval); + } + default: + return EINVAL; + } + SCARG(uap, data) = 0; + break; default: return EINVAL; } |