Annotation of Net2/sys/ioctl_compat.h, revision 1.1.1.2

1.1       root        1: /*
                      2:  * Copyright (c) 1990 The Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms, with or without
                      6:  * modification, are permitted provided that the following conditions
                      7:  * are met:
                      8:  * 1. Redistributions of source code must retain the above copyright
                      9:  *    notice, this list of conditions and the following disclaimer.
                     10:  * 2. Redistributions in binary form must reproduce the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer in the
                     12:  *    documentation and/or other materials provided with the distribution.
                     13:  * 3. All advertising materials mentioning features or use of this software
                     14:  *    must display the following acknowledgement:
                     15:  *     This product includes software developed by the University of
                     16:  *     California, Berkeley and its contributors.
                     17:  * 4. Neither the name of the University nor the names of its contributors
                     18:  *    may be used to endorse or promote products derived from this software
                     19:  *    without specific prior written permission.
                     20:  *
                     21:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     22:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     23:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     24:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     25:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     26:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     27:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     28:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     29:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     30:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     31:  * SUCH DAMAGE.
                     32:  *
                     33:  *     @(#)ioctl_compat.h      7.4 (Berkeley) 2/5/91
1.1.1.2 ! root       34:  *
        !            35:  *
        !            36:  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
        !            37:  * --------------------         -----   ----------------------
        !            38:  * CURRENT PATCH LEVEL:         1       00059
        !            39:  * --------------------         -----   ----------------------
        !            40:  *
        !            41:  * 27 Nov 1992 Scott Reynolds          Completed V7 ioctl compatablity
        !            42:  *                                     by adding gtty and stty macros
1.1       root       43:  */
                     44: 
                     45: #ifndef _IOCTL_COMPAT_H_
                     46: #define        _IOCTL_COMPAT_H_
                     47: 
                     48: #ifdef KERNEL
                     49: #include "ttychars.h"
                     50: #include "ttydev.h"
                     51: #else
                     52: #include <sys/ttychars.h>
                     53: #include <sys/ttydev.h>
                     54: #endif
                     55: 
                     56: struct tchars {
                     57:        char    t_intrc;        /* interrupt */
                     58:        char    t_quitc;        /* quit */
                     59:        char    t_startc;       /* start output */
                     60:        char    t_stopc;        /* stop output */
                     61:        char    t_eofc;         /* end-of-file */
                     62:        char    t_brkc;         /* input delimiter (like nl) */
                     63: };
                     64: 
                     65: struct ltchars {
                     66:        char    t_suspc;        /* stop process signal */
                     67:        char    t_dsuspc;       /* delayed stop process signal */
                     68:        char    t_rprntc;       /* reprint line */
                     69:        char    t_flushc;       /* flush output (toggles) */
                     70:        char    t_werasc;       /* word erase */
                     71:        char    t_lnextc;       /* literal next character */
                     72: };
                     73: 
                     74: /*
                     75:  * Structure for TIOCGETP and TIOCSETP ioctls.
                     76:  */
                     77: #ifndef _SGTTYB_
                     78: #define        _SGTTYB_
                     79: struct sgttyb {
                     80:        char    sg_ispeed;              /* input speed */
                     81:        char    sg_ospeed;              /* output speed */
                     82:        char    sg_erase;               /* erase character */
                     83:        char    sg_kill;                /* kill character */
                     84:        short   sg_flags;               /* mode flags */
                     85: };
                     86: #endif
                     87: 
                     88: #ifdef USE_OLD_TTY
                     89: # undef  TIOCGETD
                     90: # define TIOCGETD      _IOR('t', 0, int)       /* get line discipline */
                     91: # undef  TIOCSETD
                     92: # define TIOCSETD      _IOW('t', 1, int)       /* set line discipline */
                     93: #else
                     94: # define OTIOCGETD     _IOR('t', 0, int)       /* get line discipline */
                     95: # define OTIOCSETD     _IOW('t', 1, int)       /* set line discipline */
                     96: #endif
                     97: #define        TIOCHPCL        _IO('t', 2)             /* hang up on last close */
                     98: #define        TIOCGETP        _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
                     99: #define        TIOCSETP        _IOW('t', 9,struct sgttyb)/* set parameters -- stty */
                    100: #define        TIOCSETN        _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
                    101: #define        TIOCSETC        _IOW('t',17,struct tchars)/* set special characters */
                    102: #define        TIOCGETC        _IOR('t',18,struct tchars)/* get special characters */
                    103: #define                TANDEM          0x00000001      /* send stopc on out q full */
                    104: #define                CBREAK          0x00000002      /* half-cooked mode */
                    105: #define                LCASE           0x00000004      /* simulate lower case */
                    106: #define                ECHO            0x00000008      /* echo input */
                    107: #define                CRMOD           0x00000010      /* map \r to \r\n on output */
                    108: #define                RAW             0x00000020      /* no i/o processing */
                    109: #define                ODDP            0x00000040      /* get/send odd parity */
                    110: #define                EVENP           0x00000080      /* get/send even parity */
                    111: #define                ANYP            0x000000c0      /* get any parity/send none */
                    112: #define                NLDELAY         0x00000300      /* \n delay */
                    113: #define                        NL0     0x00000000
                    114: #define                        NL1     0x00000100      /* tty 37 */
                    115: #define                        NL2     0x00000200      /* vt05 */
                    116: #define                        NL3     0x00000300
                    117: #define                TBDELAY         0x00000c00      /* horizontal tab delay */
                    118: #define                        TAB0    0x00000000
                    119: #define                        TAB1    0x00000400      /* tty 37 */
                    120: #define                        TAB2    0x00000800
                    121: #define                XTABS           0x00000c00      /* expand tabs on output */
                    122: #define                CRDELAY         0x00003000      /* \r delay */
                    123: #define                        CR0     0x00000000
                    124: #define                        CR1     0x00001000      /* tn 300 */
                    125: #define                        CR2     0x00002000      /* tty 37 */
                    126: #define                        CR3     0x00003000      /* concept 100 */
                    127: #define                VTDELAY         0x00004000      /* vertical tab delay */
                    128: #define                        FF0     0x00000000
                    129: #define                        FF1     0x00004000      /* tty 37 */
                    130: #define                BSDELAY         0x00008000      /* \b delay */
                    131: #define                        BS0     0x00000000
                    132: #define                        BS1     0x00008000
                    133: #define                ALLDELAY        (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
                    134: #define                CRTBS           0x00010000      /* do backspacing for crt */
                    135: #define                PRTERA          0x00020000      /* \ ... / erase */
                    136: #define                CRTERA          0x00040000      /* " \b " to wipe out char */
                    137: #define                TILDE           0x00080000      /* hazeltine tilde kludge */
                    138: #define                MDMBUF          0x00100000      /*start/stop output on carrier*/
                    139: #define                LITOUT          0x00200000      /* literal output */
                    140: #define                TOSTOP          0x00400000      /*SIGSTOP on background output*/
                    141: #define                FLUSHO          0x00800000      /* flush output to terminal */
                    142: #define                NOHANG          0x01000000      /* (no-op) was no SIGHUP on carrier drop */
                    143: #define                L001000         0x02000000
                    144: #define                CRTKIL          0x04000000      /* kill line with " \b " */
                    145: #define                PASS8           0x08000000
                    146: #define                CTLECH          0x10000000      /* echo control chars as ^X */
                    147: #define                PENDIN          0x20000000      /* tp->t_rawq needs reread */
                    148: #define                DECCTQ          0x40000000      /* only ^Q starts after ^S */
                    149: #define                NOFLSH          0x80000000      /* no output flush on signal */
                    150: #define        TIOCLBIS        _IOW('t', 127, int)     /* bis local mode bits */
                    151: #define        TIOCLBIC        _IOW('t', 126, int)     /* bic local mode bits */
                    152: #define        TIOCLSET        _IOW('t', 125, int)     /* set entire local mode word */
                    153: #define        TIOCLGET        _IOR('t', 124, int)     /* get local modes */
                    154: #define                LCRTBS          (CRTBS>>16)
                    155: #define                LPRTERA         (PRTERA>>16)
                    156: #define                LCRTERA         (CRTERA>>16)
                    157: #define                LTILDE          (TILDE>>16)
                    158: #define                LMDMBUF         (MDMBUF>>16)
                    159: #define                LLITOUT         (LITOUT>>16)
                    160: #define                LTOSTOP         (TOSTOP>>16)
                    161: #define                LFLUSHO         (FLUSHO>>16)
                    162: #define                LNOHANG         (NOHANG>>16)
                    163: #define                LCRTKIL         (CRTKIL>>16)
                    164: #define                LPASS8          (PASS8>>16)
                    165: #define                LCTLECH         (CTLECH>>16)
                    166: #define                LPENDIN         (PENDIN>>16)
                    167: #define                LDECCTQ         (DECCTQ>>16)
                    168: #define                LNOFLSH         (NOFLSH>>16)
                    169: #define        TIOCSLTC        _IOW('t',117,struct ltchars)/* set local special chars*/
                    170: #define        TIOCGLTC        _IOR('t',116,struct ltchars)/* get local special chars*/
                    171: #define OTIOCCONS      _IO('t', 98)    /* for hp300 -- sans int arg */
                    172: #define        OTTYDISC        0
                    173: #define        NETLDISC        1
                    174: #define        NTTYDISC        2
                    175: 
1.1.1.2 ! root      176: #define        gtty(fd, tty)   ioctl(fd, TIOCGETP, tty)
        !           177: #define        stty(fd, tty)   ioctl(fd, TIOCSETP, tty)
        !           178: 
1.1       root      179: #endif /* !_IOCTL_COMPAT_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.