BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / sys / ioctl.h
index 8861ab2..4929a84 100644 (file)
@@ -2,9 +2,35 @@
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
  * All rights reserved.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)ioctl.h     7.18 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)ioctl.h     7.19 (Berkeley) 6/26/91
  */
 
 #ifndef        _IOCTL_H_
  */
 
 #ifndef        _IOCTL_H_
@@ -48,7 +74,7 @@ struct ttysize {
 #define        IOC_OUT         0x40000000      /* copy out parameters */
 #define        IOC_IN          0x80000000      /* copy in parameters */
 #define        IOC_INOUT       (IOC_IN|IOC_OUT)
 #define        IOC_OUT         0x40000000      /* copy out parameters */
 #define        IOC_IN          0x80000000      /* copy in parameters */
 #define        IOC_INOUT       (IOC_IN|IOC_OUT)
-#define        IOC_DIRMASK     (IOC_IN|IOC_OUT|IOC_VOID)
+#define        IOC_DIRMASK     0xe0000000      /* mask for IN/OUT/VOID */
 
 #define _IOC(inout,group,num,len) \
        (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
 
 #define _IOC(inout,group,num,len) \
        (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
@@ -57,7 +83,6 @@ struct ttysize {
 #define        _IOW(g,n,t)     _IOC(IOC_IN,    (g), (n), sizeof(t))
 /* this should be _IORW, but stdio got there first */
 #define        _IOWR(g,n,t)    _IOC(IOC_INOUT, (g), (n), sizeof(t))
 #define        _IOW(g,n,t)     _IOC(IOC_IN,    (g), (n), sizeof(t))
 /* this should be _IORW, but stdio got there first */
 #define        _IOWR(g,n,t)    _IOC(IOC_INOUT, (g), (n), sizeof(t))
-#define        _IOWX(x,y,s)    (IOC_IN|(((s)&IOCPARM_MASK)<<16)|(x<<8)|(y))
 
 #define        TIOCMODG        _IOR('t', 3, int)       /* get modem control state */
 #define        TIOCMODS        _IOW('t', 4, int)       /* set modem control state */
 
 #define        TIOCMODG        _IOR('t', 3, int)       /* get modem control state */
 #define        TIOCMODS        _IOW('t', 4, int)       /* set modem control state */
@@ -104,7 +129,6 @@ struct ttysize {
 #define                TIOCPKT_NOSTOP          0x10    /* no more ^S, ^Q */
 #define                TIOCPKT_DOSTOP          0x20    /* now do ^S ^Q */
 #define                TIOCPKT_IOCTL           0x40    /* state change of pty driver */
 #define                TIOCPKT_NOSTOP          0x10    /* no more ^S, ^Q */
 #define                TIOCPKT_DOSTOP          0x20    /* now do ^S ^Q */
 #define                TIOCPKT_IOCTL           0x40    /* state change of pty driver */
-#define                TIOCPKT_TIOC            0x40    /* transparent ioctl packet */
 #define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
 #define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
 #define        TIOCMSET        _IOW('t', 109, int)     /* set all modem bits */
 #define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
 #define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
 #define        TIOCMSET        _IOW('t', 109, int)     /* set all modem bits */
@@ -114,11 +138,8 @@ struct ttysize {
 #define        TIOCREMOTE      _IOW('t', 105, int)     /* remote input editing */
 #define        TIOCGWINSZ      _IOR('t', 104, struct winsize)  /* get window size */
 #define        TIOCSWINSZ      _IOW('t', 103, struct winsize)  /* set window size */
 #define        TIOCREMOTE      _IOW('t', 105, int)     /* remote input editing */
 #define        TIOCGWINSZ      _IOR('t', 104, struct winsize)  /* get window size */
 #define        TIOCSWINSZ      _IOW('t', 103, struct winsize)  /* set window size */
-#define                UIOCCMD(n)      _IO('u', n)             /* usr cntl op "n" */
 #define        TIOCUCNTL       _IOW('t', 102, int)     /* pty: set/clr usr cntl mode */
 #define        TIOCUCNTL       _IOW('t', 102, int)     /* pty: set/clr usr cntl mode */
-#define        TIOCTIOC        _IOW('t', 101, int)     /* pty: set/clr transparent */
-#define        TIOCBLK         _IOW('t', 100, int)     /* pty: block slave writes */
-#define        TIOCIOANS(s)    _IOWX('t', 99, (s))     /* pty: reply to user ioctl */
+#define                UIOCCMD(n)      _IO('u', n)             /* usr cntl op "n" */
 #define        TIOCCONS        _IOW('t', 98, int)              /* become virtual console */
 #define        TIOCSCTTY       _IO('t', 97)            /* become controlling tty */
 #define        TIOCEXT         _IOW('t', 96, int)      /* pty: external processing */
 #define        TIOCCONS        _IOW('t', 98, int)              /* become virtual console */
 #define        TIOCSCTTY       _IO('t', 97)            /* become controlling tty */
 #define        TIOCEXT         _IOW('t', 96, int)      /* pty: external processing */
@@ -129,19 +150,6 @@ struct ttysize {
 #define        TABLDISC        3               /* tablet discipline */
 #define        SLIPDISC        4               /* serial IP discipline */
 
 #define        TABLDISC        3               /* tablet discipline */
 #define        SLIPDISC        4               /* serial IP discipline */
 
-/*
- * Compatability with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43)
-#ifdef KERNEL
-#include "ioctl_compat.h"
-#else
-#include <sys/ioctl_compat.h>
-#endif
-#endif
 
 #define        FIOCLEX         _IO('f', 1)             /* set close on exec on fd */
 #define        FIONCLEX        _IO('f', 2)             /* remove close on exec */
 
 #define        FIOCLEX         _IO('f', 1)             /* set close on exec on fd */
 #define        FIONCLEX        _IO('f', 2)             /* remove close on exec */
@@ -200,3 +208,17 @@ __END_DECLS
 #endif /* !KERNEL */
 
 #endif /* !_IOCTL_H_ */
 #endif /* !KERNEL */
 
 #endif /* !_IOCTL_H_ */
+
+/* - note: keep outside _IOCTL_H_
+ * Compatability with old terminal driver
+ *
+ * Source level -> #define USE_OLD_TTY
+ * Kernel level -> options COMPAT_43
+ */
+#if defined(USE_OLD_TTY) || defined(COMPAT_43)
+#ifdef KERNEL
+#include "ioctl_compat.h"
+#else
+#include <sys/ioctl_compat.h>
+#endif
+#endif