From 6adf4ee838950e7444ae0fa0d88e3f85332d26c2 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 30 Dec 1995 08:53:13 +0000 Subject: from netbsd: Take a stab at implementing TCXONC and TCFLSH --- sys/compat/ibcs2/ibcs2_ioctl.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'sys/compat/ibcs2') diff --git a/sys/compat/ibcs2/ibcs2_ioctl.c b/sys/compat/ibcs2/ibcs2_ioctl.c index f5b4763ecd5..61729dc05b1 100644 --- a/sys/compat/ibcs2/ibcs2_ioctl.c +++ b/sys/compat/ibcs2/ibcs2_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_ioctl.c,v 1.9 1995/10/10 02:35:16 mycroft Exp $ */ +/* $NetBSD: ibcs2_ioctl.c,v 1.10 1995/12/26 17:56:36 mycroft Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -451,12 +451,40 @@ ibcs2_sys_ioctl(p, v, retval) return ENOSYS; case IBCS2_TCXONC: - DPRINTF(("ibcs2_ioctl(%d): TCXONC ", p->p_pid)); - return ENOSYS; + { + switch ((int)SCARG(uap, data)) { + case 0: + case 1: + DPRINTF(("ibcs2_ioctl(%d): TCXONC ", p->p_pid)); + return ENOSYS; + case 2: + return (*ctl)(fp, TIOCSTOP, (caddr_t)0, p); + case 3: + return (*ctl)(fp, TIOCSTART, (caddr_t)1, p); + default: + return EINVAL; + } + } case IBCS2_TCFLSH: - DPRINTF(("ibcs2_ioctl(%d): TCFLSH ", p->p_pid)); - return ENOSYS; + { + int arg; + + switch ((int)SCARG(uap, data)) { + case 0: + arg = FREAD; + break; + case 1: + arg = FWRITE; + break; + case 2: + arg = FREAD | FWRITE; + break; + default: + return EINVAL; + } + return (*ctl)(fp, TIOCFLUSH, (caddr_t)&arg, p); + } case IBCS2_TIOCGWINSZ: SCARG(uap, cmd) = TIOCGWINSZ; -- cgit v1.2.3