Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 1999 15:46:58 +0200
From:      Marcel Moolenaar <marcel@scc.nl>
To:        emulation@FreeBSD.ORG
Subject:   RQ for review: Implementation of TCXONC ioctl
Message-ID:  <378F37D2.9F82D37A@scc.nl>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?378F37D2.9F82D37A>