1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)ioctl.h	7.1 (Berkeley) 6/4/86
   7:  */
   8: 
   9: /*
  10:  * Ioctl definitions
  11:  */
  12: #ifndef _IOCTL_
  13: #define _IOCTL_
  14: #ifdef KERNEL
  15: #include "ttychars.h"
  16: #include "ttydev.h"
  17: #else
  18: #include <sys/ttychars.h>
  19: #include <sys/ttydev.h>
  20: #endif
  21: 
  22: struct tchars {
  23:     char    t_intrc;    /* interrupt */
  24:     char    t_quitc;    /* quit */
  25:     char    t_startc;   /* start output */
  26:     char    t_stopc;    /* stop output */
  27:     char    t_eofc;     /* end-of-file */
  28:     char    t_brkc;     /* input delimiter (like nl) */
  29: };
  30: struct ltchars {
  31:     char    t_suspc;    /* stop process signal */
  32:     char    t_dsuspc;   /* delayed stop process signal */
  33:     char    t_rprntc;   /* reprint line */
  34:     char    t_flushc;   /* flush output (toggles) */
  35:     char    t_werasc;   /* word erase */
  36:     char    t_lnextc;   /* literal next character */
  37: };
  38: 
  39: /*
  40:  * Structure for TIOCGETP and TIOCSETP ioctls.
  41:  */
  42: 
  43: #ifndef _SGTTYB_
  44: #define _SGTTYB_
  45: struct sgttyb {
  46:     char    sg_ispeed;      /* input speed */
  47:     char    sg_ospeed;      /* output speed */
  48:     char    sg_erase;       /* erase character */
  49:     char    sg_kill;        /* kill character */
  50:     short   sg_flags;       /* mode flags */
  51: };
  52: #endif
  53: 
  54: /*
  55:  * Window/terminal size structure.
  56:  * This information is stored by the kernel
  57:  * in order to provide a consistent interface,
  58:  * but is not used by the kernel.
  59:  *
  60:  * Type must be "unsigned short" so that types.h not required.
  61:  */
  62: struct winsize {
  63:     unsigned short  ws_row;         /* rows, in characters */
  64:     unsigned short  ws_col;         /* columns, in characters */
  65:     unsigned short  ws_xpixel;      /* horizontal size, pixels */
  66:     unsigned short  ws_ypixel;      /* vertical size, pixels */
  67: };
  68: 
  69: /*
  70:  * Pun for SUN.
  71:  */
  72: struct ttysize {
  73:     unsigned short  ts_lines;
  74:     unsigned short  ts_cols;
  75:     unsigned short  ts_xxx;
  76:     unsigned short  ts_yyy;
  77: };
  78: #define TIOCGSIZE   TIOCGWINSZ
  79: #define TIOCSSIZE   TIOCSWINSZ
  80: 
  81: #ifndef _IO
  82: /*
  83:  * Ioctl's have the command encoded in the lower word,
  84:  * and the size of any in or out parameters in the upper
  85:  * word.  The high 2 bits of the upper word are used
  86:  * to encode the in/out status of the parameter; for now
  87:  * we restrict parameters to at most 128 bytes.
  88:  */
  89: #define IOCPARM_MASK    0x7f        /* parameters must be < 128 bytes */
  90: #define IOC_VOID    0x20000000  /* no parameters */
  91: #define IOC_OUT     0x40000000  /* copy out parameters */
  92: #define IOC_IN      0x80000000  /* copy in parameters */
  93: #define IOC_INOUT   (IOC_IN|IOC_OUT)
  94: /* the 0x20000000 is so we can distinguish new ioctl's from old */
  95: #define _IO(x,y)    (IOC_VOID|('x'<<8)|y)
  96: #define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|('x'<<8)|y)
  97: #define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|('x'<<8)|y)
  98: /* this should be _IORW, but stdio got there first */
  99: #define _IOWR(x,y,t)    (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|('x'<<8)|y)
 100: #endif
 101: 
 102: /*
 103:  * tty ioctl commands
 104:  */
 105: #define TIOCGETD    _IOR(t, 0, int)     /* get line discipline */
 106: #define TIOCSETD    _IOW(t, 1, int)     /* set line discipline */
 107: #define TIOCHPCL    _IO(t, 2)       /* hang up on last close */
 108: #define TIOCMODG    _IOR(t, 3, int)     /* get modem control state */
 109: #define TIOCMODS    _IOW(t, 4, int)     /* set modem control state */
 110: #define     TIOCM_LE    0001        /* line enable */
 111: #define     TIOCM_DTR   0002        /* data terminal ready */
 112: #define     TIOCM_RTS   0004        /* request to send */
 113: #define     TIOCM_ST    0010        /* secondary transmit */
 114: #define     TIOCM_SR    0020        /* secondary receive */
 115: #define     TIOCM_CTS   0040        /* clear to send */
 116: #define     TIOCM_CAR   0100        /* carrier detect */
 117: #define     TIOCM_CD    TIOCM_CAR
 118: #define     TIOCM_RNG   0200        /* ring */
 119: #define     TIOCM_RI    TIOCM_RNG
 120: #define     TIOCM_DSR   0400        /* data set ready */
 121: #define TIOCGETP    _IOR(t, 8,struct sgttyb)/* get parameters -- gtty */
 122: #define TIOCSETP    _IOW(t, 9,struct sgttyb)/* set parameters -- stty */
 123: #define TIOCSETN    _IOW(t,10,struct sgttyb)/* as above, but no flushtty */
 124: #define TIOCEXCL    _IO(t, 13)      /* set exclusive use of tty */
 125: #define TIOCNXCL    _IO(t, 14)      /* reset exclusive use of tty */
 126: #define TIOCFLUSH   _IOW(t, 16, int)    /* flush buffers */
 127: #define TIOCSETC    _IOW(t,17,struct tchars)/* set special characters */
 128: #define TIOCGETC    _IOR(t,18,struct tchars)/* get special characters */
 129: #define     TANDEM      0x00000001  /* send stopc on out q full */
 130: #define     CBREAK      0x00000002  /* half-cooked mode */
 131: #define     LCASE       0x00000004  /* simulate lower case */
 132: #define     ECHO        0x00000008  /* echo input */
 133: #define     CRMOD       0x00000010  /* map \r to \r\n on output */
 134: #define     RAW     0x00000020  /* no i/o processing */
 135: #define     ODDP        0x00000040  /* get/send odd parity */
 136: #define     EVENP       0x00000080  /* get/send even parity */
 137: #define     ANYP        0x000000c0  /* get any parity/send none */
 138: #define     NLDELAY     0x00000300  /* \n delay */
 139: #define         NL0 0x00000000
 140: #define         NL1 0x00000100  /* tty 37 */
 141: #define         NL2 0x00000200  /* vt05 */
 142: #define         NL3 0x00000300
 143: #define     TBDELAY     0x00000c00  /* horizontal tab delay */
 144: #define         TAB0    0x00000000
 145: #define         TAB1    0x00000400  /* tty 37 */
 146: #define         TAB2    0x00000800
 147: #define     XTABS       0x00000c00  /* expand tabs on output */
 148: #define     CRDELAY     0x00003000  /* \r delay */
 149: #define         CR0 0x00000000
 150: #define         CR1 0x00001000  /* tn 300 */
 151: #define         CR2 0x00002000  /* tty 37 */
 152: #define         CR3 0x00003000  /* concept 100 */
 153: #define     VTDELAY     0x00004000  /* vertical tab delay */
 154: #define         FF0 0x00000000
 155: #define         FF1 0x00004000  /* tty 37 */
 156: #define     BSDELAY     0x00008000  /* \b delay */
 157: #define         BS0 0x00000000
 158: #define         BS1 0x00008000
 159: #define     ALLDELAY    (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
 160: #define     CRTBS       0x00010000  /* do backspacing for crt */
 161: #define     PRTERA      0x00020000  /* \ ... / erase */
 162: #define     CRTERA      0x00040000  /* " \b " to wipe out char */
 163: #define     TILDE       0x00080000  /* hazeltine tilde kludge */
 164: #define     MDMBUF      0x00100000  /* start/stop output on carrier intr */
 165: #define     LITOUT      0x00200000  /* literal output */
 166: #define     TOSTOP      0x00400000  /* SIGSTOP on background output */
 167: #define     FLUSHO      0x00800000  /* flush output to terminal */
 168: #define     NOHANG      0x01000000  /* no SIGHUP on carrier drop */
 169: #define     L001000     0x02000000
 170: #define     CRTKIL      0x04000000  /* kill line with " \b " */
 171: #define     PASS8       0x08000000
 172: #define     CTLECH      0x10000000  /* echo control chars as ^X */
 173: #define     PENDIN      0x20000000  /* tp->t_rawq needs reread */
 174: #define     DECCTQ      0x40000000  /* only ^Q starts after ^S */
 175: #define     NOFLSH      0x80000000  /* no output flush on signal */
 176: /* locals, from 127 down */
 177: #define TIOCLBIS    _IOW(t, 127, int)   /* bis local mode bits */
 178: #define TIOCLBIC    _IOW(t, 126, int)   /* bic local mode bits */
 179: #define TIOCLSET    _IOW(t, 125, int)   /* set entire local mode word */
 180: #define TIOCLGET    _IOR(t, 124, int)   /* get local modes */
 181: #define     LCRTBS      (CRTBS>>16)
 182: #define     LPRTERA     (PRTERA>>16)
 183: #define     LCRTERA     (CRTERA>>16)
 184: #define     LTILDE      (TILDE>>16)
 185: #define     LMDMBUF     (MDMBUF>>16)
 186: #define     LLITOUT     (LITOUT>>16)
 187: #define     LTOSTOP     (TOSTOP>>16)
 188: #define     LFLUSHO     (FLUSHO>>16)
 189: #define     LNOHANG     (NOHANG>>16)
 190: #define     LCRTKIL     (CRTKIL>>16)
 191: #define     LPASS8      (PASS8>>16)
 192: #define     LCTLECH     (CTLECH>>16)
 193: #define     LPENDIN     (PENDIN>>16)
 194: #define     LDECCTQ     (DECCTQ>>16)
 195: #define     LNOFLSH     (NOFLSH>>16)
 196: #define TIOCSBRK    _IO(t, 123)     /* set break bit */
 197: #define TIOCCBRK    _IO(t, 122)     /* clear break bit */
 198: #define TIOCSDTR    _IO(t, 121)     /* set data terminal ready */
 199: #define TIOCCDTR    _IO(t, 120)     /* clear data terminal ready */
 200: #define TIOCGPGRP   _IOR(t, 119, int)   /* get pgrp of tty */
 201: #define TIOCSPGRP   _IOW(t, 118, int)   /* set pgrp of tty */
 202: #define TIOCSLTC    _IOW(t,117,struct ltchars)/* set local special chars */
 203: #define TIOCGLTC    _IOR(t,116,struct ltchars)/* get local special chars */
 204: #define TIOCOUTQ    _IOR(t, 115, int)   /* output queue size */
 205: #define TIOCSTI     _IOW(t, 114, char)  /* simulate terminal input */
 206: #define TIOCNOTTY   _IO(t, 113)     /* void tty association */
 207: #define TIOCPKT     _IOW(t, 112, int)   /* pty: set/clear packet mode */
 208: #define     TIOCPKT_DATA        0x00    /* data packet */
 209: #define     TIOCPKT_FLUSHREAD   0x01    /* flush packet */
 210: #define     TIOCPKT_FLUSHWRITE  0x02    /* flush packet */
 211: #define     TIOCPKT_STOP        0x04    /* stop output */
 212: #define     TIOCPKT_START       0x08    /* start output */
 213: #define     TIOCPKT_NOSTOP      0x10    /* no more ^S, ^Q */
 214: #define     TIOCPKT_DOSTOP      0x20    /* now do ^S ^Q */
 215: #define TIOCSTOP    _IO(t, 111)     /* stop output, like ^S */
 216: #define TIOCSTART   _IO(t, 110)     /* start output, like ^Q */
 217: #define TIOCMSET    _IOW(t, 109, int)   /* set all modem bits */
 218: #define TIOCMBIS    _IOW(t, 108, int)   /* bis modem bits */
 219: #define TIOCMBIC    _IOW(t, 107, int)   /* bic modem bits */
 220: #define TIOCMGET    _IOR(t, 106, int)   /* get all modem bits */
 221: #define TIOCREMOTE  _IOW(t, 105, int)   /* remote input editing */
 222: #define TIOCGWINSZ  _IOR(t, 104, struct winsize)    /* get window size */
 223: #define TIOCSWINSZ  _IOW(t, 103, struct winsize)    /* set window size */
 224: #define TIOCUCNTL   _IOW(t, 102, int)   /* pty: set/clr usr cntl mode */
 225: #define     UIOCCMD(n)  _IO(u, n)       /* usr cntl op "n" */
 226: 
 227: #define OTTYDISC    0       /* old, v7 std tty driver */
 228: #define NETLDISC    1       /* line discip for berk net */
 229: #define NTTYDISC    2       /* new tty discipline */
 230: #define TABLDISC    3       /* tablet discipline */
 231: #define SLIPDISC    4       /* serial IP discipline */
 232: 
 233: #define FIOCLEX     _IO(f, 1)       /* set exclusive use on fd */
 234: #define FIONCLEX    _IO(f, 2)       /* remove exclusive use */
 235: /* another local */
 236: #define FIONREAD    _IOR(f, 127, int)   /* get # bytes to read */
 237: #define FIONBIO     _IOW(f, 126, int)   /* set/clear non-blocking i/o */
 238: #define FIOASYNC    _IOW(f, 125, int)   /* set/clear async i/o */
 239: #define FIOSETOWN   _IOW(f, 124, int)   /* set owner */
 240: #define FIOGETOWN   _IOR(f, 123, int)   /* get owner */
 241: 
 242: /* socket i/o controls */
 243: #define SIOCSHIWAT  _IOW(s,  0, int)        /* set high watermark */
 244: #define SIOCGHIWAT  _IOR(s,  1, int)        /* get high watermark */
 245: #define SIOCSLOWAT  _IOW(s,  2, int)        /* set low watermark */
 246: #define SIOCGLOWAT  _IOR(s,  3, int)        /* get low watermark */
 247: #define SIOCATMARK  _IOR(s,  7, int)        /* at oob mark? */
 248: #define SIOCSPGRP   _IOW(s,  8, int)        /* set process group */
 249: #define SIOCGPGRP   _IOR(s,  9, int)        /* get process group */
 250: 
 251: #define SIOCADDRT   _IOW(r, 10, struct rtentry) /* add route */
 252: #define SIOCDELRT   _IOW(r, 11, struct rtentry) /* delete route */
 253: 
 254: #define SIOCSIFADDR _IOW(i, 12, struct ifreq)   /* set ifnet address */
 255: #define SIOCGIFADDR _IOWR(i,13, struct ifreq)   /* get ifnet address */
 256: #define SIOCSIFDSTADDR  _IOW(i, 14, struct ifreq)   /* set p-p address */
 257: #define SIOCGIFDSTADDR  _IOWR(i,15, struct ifreq)   /* get p-p address */
 258: #define SIOCSIFFLAGS    _IOW(i, 16, struct ifreq)   /* set ifnet flags */
 259: #define SIOCGIFFLAGS    _IOWR(i,17, struct ifreq)   /* get ifnet flags */
 260: #define SIOCGIFBRDADDR  _IOWR(i,18, struct ifreq)   /* get broadcast addr */
 261: #define SIOCSIFBRDADDR  _IOW(i,19, struct ifreq)    /* set broadcast addr */
 262: #define SIOCGIFCONF _IOWR(i,20, struct ifconf)  /* get ifnet list */
 263: #define SIOCGIFNETMASK  _IOWR(i,21, struct ifreq)   /* get net addr mask */
 264: #define SIOCSIFNETMASK  _IOW(i,22, struct ifreq)    /* set net addr mask */
 265: #define SIOCGIFMETRIC   _IOWR(i,23, struct ifreq)   /* get IF metric */
 266: #define SIOCSIFMETRIC   _IOW(i,24, struct ifreq)    /* set IF metric */
 267: 
 268: #define SIOCSARP    _IOW(i, 30, struct arpreq)  /* set arp entry */
 269: #define SIOCGARP    _IOWR(i,31, struct arpreq)  /* get arp entry */
 270: #define SIOCDARP    _IOW(i, 32, struct arpreq)  /* delete arp entry */
 271: 
 272: #endif

Defined struct's

ltchars defined in line 30; used 4 times
sgttyb defined in line 45; used 8 times
tchars defined in line 22; used 4 times
ttysize defined in line 72; never used
winsize defined in line 62; used 6 times

Defined macros

ALLDELAY defined in line 159; never used
ANYP defined in line 137; never used
BS0 defined in line 157; never used
BS1 defined in line 158; never used
BSDELAY defined in line 156; used 1 times
CBREAK defined in line 130; used 12 times
CR0 defined in line 149; never used
CR1 defined in line 150; never used
CR2 defined in line 151; never used
CR3 defined in line 152; never used
CRDELAY defined in line 148; used 1 times
CRMOD defined in line 133; used 5 times
CRTBS defined in line 160; used 2 times
CRTERA defined in line 162; used 2 times
CRTKIL defined in line 170; used 2 times
CTLECH defined in line 172; used 3 times
DECCTQ defined in line 174; used 2 times
EVENP defined in line 136; used 31 times
FF0 defined in line 154; never used
FF1 defined in line 155; never used
FIOCLEX defined in line 233; used 2 times
FIOGETOWN defined in line 240; never used
FIONCLEX defined in line 234; used 2 times
FIONREAD defined in line 236; used 2 times
FIOSETOWN defined in line 239; never used
FLUSHO defined in line 167; used 18 times
IOCPARM_MASK defined in line 89; used 4 times
IOC_IN defined in line 92; used 3 times
IOC_INOUT defined in line 93; used 2 times
IOC_OUT defined in line 91; used 4 times
IOC_VOID defined in line 90; used 3 times
L001000 defined in line 169; never used
LCASE defined in line 131; used 5 times
LCRTBS defined in line 181; never used
LCRTERA defined in line 183; never used
LCRTKIL defined in line 190; never used
LCTLECH defined in line 192; never used
LDECCTQ defined in line 194; never used
LFLUSHO defined in line 188; never used
LLITOUT defined in line 186; never used
LMDMBUF defined in line 185; never used
LNOFLSH defined in line 195; never used
LNOHANG defined in line 189; never used
LPASS8 defined in line 191; never used
LPENDIN defined in line 193; never used
LPRTERA defined in line 182; never used
LTILDE defined in line 184; never used
LTOSTOP defined in line 187; never used
MDMBUF defined in line 164; used 2 times
NL0 defined in line 139; never used
NL1 defined in line 140; never used
NL2 defined in line 141; never used
NL3 defined in line 142; never used
NLDELAY defined in line 138; used 1 times
NOFLSH defined in line 175; used 3 times
NOHANG defined in line 168; used 2 times
NTTYDISC defined in line 229; used 7 times
ODDP defined in line 135; used 25 times
OTTYDISC defined in line 227; never used
PENDIN defined in line 173; used 7 times
PRTERA defined in line 161; used 2 times
SIOCADDRT defined in line 251; used 9 times
SIOCATMARK defined in line 247; never used
SIOCDARP defined in line 270; never used
SIOCGARP defined in line 269; never used
SIOCGHIWAT defined in line 244; never used
SIOCGIFADDR defined in line 255; never used
SIOCGIFBRDADDR defined in line 260; never used
SIOCGIFCONF defined in line 262; never used
SIOCGIFDSTADDR defined in line 257; never used
SIOCGIFFLAGS defined in line 259; never used
SIOCGIFMETRIC defined in line 265; never used
SIOCGIFNETMASK defined in line 263; never used
SIOCGLOWAT defined in line 246; never used
SIOCGPGRP defined in line 249; never used
SIOCSARP defined in line 268; used 1 times
SIOCSHIWAT defined in line 243; never used
SIOCSIFBRDADDR defined in line 261; never used
SIOCSIFFLAGS defined in line 258; never used
SIOCSIFMETRIC defined in line 266; never used
SIOCSIFNETMASK defined in line 264; never used
SIOCSLOWAT defined in line 245; never used
SIOCSPGRP defined in line 248; never used
SLIPDISC defined in line 231; used 1 times
TAB0 defined in line 144; never used
TAB1 defined in line 145; never used
TAB2 defined in line 146; never used
TABLDISC defined in line 230; never used
TANDEM defined in line 129; used 1 times
TBDELAY defined in line 143; used 2 times
TILDE defined in line 163; used 3 times
TIOCCBRK defined in line 197; used 1 times
TIOCCDTR defined in line 199; used 1 times
TIOCEXCL defined in line 124; used 1 times
TIOCFLUSH defined in line 126; used 1 times
TIOCGETC defined in line 128; used 1 times
TIOCGETD defined in line 105; used 2 times
TIOCGETP defined in line 121; used 1 times
TIOCGLTC defined in line 203; used 1 times
TIOCGSIZE defined in line 78; never used
TIOCGWINSZ defined in line 222; used 1 times
  • in line 78
TIOCHPCL defined in line 107; used 1 times
TIOCLGET defined in line 180; used 1 times
TIOCMBIC defined in line 219; used 1 times
TIOCMBIS defined in line 218; used 1 times
TIOCMGET defined in line 220; used 1 times
TIOCMODG defined in line 108; used 1 times
TIOCMODS defined in line 109; used 1 times
TIOCMSET defined in line 217; used 1 times
TIOCM_CAR defined in line 116; used 1 times
TIOCM_CD defined in line 117; never used
TIOCM_CTS defined in line 115; never used
TIOCM_DSR defined in line 120; never used
TIOCM_DTR defined in line 111; never used
TIOCM_LE defined in line 110; never used
TIOCM_RI defined in line 119; never used
TIOCM_RNG defined in line 118; used 1 times
TIOCM_RTS defined in line 112; never used
TIOCM_SR defined in line 114; never used
TIOCM_ST defined in line 113; never used
TIOCNOTTY defined in line 206; used 2 times
TIOCNXCL defined in line 125; used 1 times
TIOCOUTQ defined in line 204; used 1 times
TIOCPKT defined in line 207; used 1 times
TIOCPKT_DATA defined in line 208; never used
TIOCPKT_DOSTOP defined in line 214; used 2 times
TIOCPKT_FLUSHREAD defined in line 209; never used
TIOCPKT_FLUSHWRITE defined in line 210; never used
TIOCPKT_NOSTOP defined in line 213; used 2 times
TIOCPKT_START defined in line 212; used 1 times
TIOCPKT_STOP defined in line 211; used 1 times
TIOCREMOTE defined in line 221; used 1 times
TIOCSBRK defined in line 196; used 1 times
TIOCSDTR defined in line 198; used 1 times
TIOCSETC defined in line 127; used 1 times
TIOCSETD defined in line 106; used 1 times
TIOCSLTC defined in line 202; used 1 times
TIOCSSIZE defined in line 79; never used
TIOCSTART defined in line 216; used 1 times
TIOCSTI defined in line 205; used 1 times
TIOCSTOP defined in line 215; used 1 times
TIOCSWINSZ defined in line 223; used 1 times
  • in line 79
TIOCUCNTL defined in line 224; never used
TOSTOP defined in line 166; used 2 times
UIOCCMD defined in line 225; used 1 times
VTDELAY defined in line 153; used 2 times
XTABS defined in line 147; used 2 times
_IO defined in line 95; used 14 times
_IOCTL_ defined in line 13; used 2 times
_IOR defined in line 96; used 21 times
_IOW defined in line 97; used 40 times
_IOWR defined in line 99; used 8 times
_SGTTYB_ defined in line 44; used 1 times
  • in line 43

Usage of this include

ioctl.h used 58 times
Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2987
Valid CSS Valid XHTML 1.0 Strict