From owner-freebsd-emulation Fri Jul 16 6:47:43 1999 Delivered-To: freebsd-emulation@freebsd.org Received: from gaia.euronet.nl (gaia.euronet.nl [194.134.0.10]) by hub.freebsd.org (Postfix) with ESMTP id CCF0E14D3F for ; Fri, 16 Jul 1999 06:47:39 -0700 (PDT) (envelope-from freebsd-emulation@scc.nl) Received: from scones.sup.scc.nl (i041.ztm.euronet.nl [194.134.112.42]) by gaia.euronet.nl (8.8.8/8.8.8) with ESMTP id PAA25123 from for ; Fri, 16 Jul 1999 15:47:34 +0200 (MET DST) Received: (from daemon@localhost) by scones.sup.scc.nl (8.9.3/8.9.3) id PAA78265 for emulation@FreeBSD.ORG; Fri, 16 Jul 1999 15:47:01 +0200 (CEST) (envelope-from freebsd-emulation@scc.nl) Received: from GATEWAY by scones.sup.scc.nl with netnews for emulation@FreeBSD.ORG (emulation@FreeBSD.ORG) To: emulation@FreeBSD.ORG Date: Fri, 16 Jul 1999 15:46:58 +0200 From: Marcel Moolenaar Message-ID: <378F37D2.9F82D37A@scc.nl> Organization: SCC vof Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RQ for review: Implementation of TCXONC ioctl Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, The following implementation is about to be committed. Please review the code. This code is inspired by the tcflow(3). Index: linux.h =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux.h,v retrieving revision 1.29 diff -u -r1.29 linux.h --- linux.h 1999/07/08 16:15:18 1.29 +++ linux.h 1999/07/16 13:10:23 @@ -243,7 +243,11 @@ #define LINUX_VT_ACTIVATE 0x5606 #define LINUX_VT_WAITACTIVE 0x5607 - +/* arguments for tcflow() and LINUX_TCXONC */ +#define LINUX_TCOOFF 0 +#define LINUX_TCOON 1 +#define LINUX_TCIOFF 2 +#define LINUX_TCION 3 /* arguments for tcflush() and LINUX_TCFLSH */ #define LINUX_TCIFLUSH 0 Index: linux_ioctl.c =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_ioctl.c,v retrieving revision 1.35 diff -u -r1.35 linux_ioctl.c --- linux_ioctl.c 1999/07/08 16:15:19 1.35 +++ linux_ioctl.c 1999/07/16 13:43:00 @@ -986,6 +986,37 @@ linux_tiocsserial(fp, (struct linux_serial_struct *)args->arg); return 0; + case LINUX_TCXONC: + switch (args->arg) { + case LINUX_TCOOFF: + args->cmd = TIOCSTOP; + break; + case LINUX_TCOON: + args->cmd = TIOCSTART; + break; + case LINUX_TCIOFF: + case LINUX_TCION: { + u_char c; + struct write_args wr; + error = (*func)(fp, TIOCGETA, (caddr_t)&bsd_termios, p); + if (error != 0) + return error; + c = bsd_termios.c_cc[args->arg == LINUX_TCIOFF ? VSTOP : VSTART]; + if (c != _POSIX_VDISABLE) { + wr.fd = args->fd; + wr.buf = &c; + wr.nbyte = sizeof(c); + return write(p, &wr); + } + else + return (0); + } + default: + return EINVAL; + } + args->arg = 0; + return ioctl(p, (struct ioctl_args *)args); + case LINUX_TCFLSH: args->cmd = TIOCFLUSH; switch (args->arg) { -- Marcel Moolenaar mailto:marcel@scc.nl SCC Internetworking & Databases http://www.scc.nl/ Amsterdam, The Netherlands tel: +31 20 4200655 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message