|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: @ T i
Length: 11167 (0x2b9f)
Types: TextFile
Notes: @(#)ioctl.h 13.6 (RC International) 91/08/30 */
Names: »ioctl.h«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/include/sys/ioctl.h«
/* @(#)ioctl.h 13.6 (RC International) 91/08/30 */
#ifndef __IOCTL
#define __IOCTL
/*
* Ioctl's have the command encoded in the lower word, and the size of any
* in or out parameters in the upper word. The high 3 bits of the upper
* word are used to encode the in/out status of the parameter; for now we
* restrict parameters to at most 255 bytes.
*/
#define __IOCPARM_MASK 0xFF /* parameters must be < 255 bytes */
#define __IOC_VOID (unsigned)0x20000000 /* no parameters */
#define __IOC_OUT (unsigned)0x40000000 /* copy parameters out */
#define __IOC_IN (unsigned)0x80000000 /* copy parameters in */
#define __IOC_INOUT __IOC_OUT | __IOC_IN /* copy parameters in/out */
#define __IOC_PARAM(typ) ((sizeof(typ)&__IOCPARM_MASK)<<16)
#define _IOC(cls,sub) ((cls<<8)|sub)
#define _IO(cls,sub) (__IOC_VOID|_IOC(cls,sub))
#define _IOR(cls,sub,typ) (__IOC_OUT|_IOC(cls,sub)|__IOC_PARAM(typ))
#define _IOW(cls,sub,typ) (__IOC_IN|_IOC(cls,sub)|__IOC_PARAM(typ))
#define _IOWR(cls,sub,typ) (__IOC_INOUT|_IOC(cls,sub)|__IOC_PARAM(typ))
/*
* Some macros to interpret the ioctl command.
*/
#define IS_IOCTL(cmd, c) ((((unsigned)cmd & (0xff << 8)) >> 8) == c)
#define IS_IOR(cmd) (((unsigned)cmd & __IOC_OUT) == __IOC_OUT)
#define IS_IOW(cmd) (((unsigned)cmd & __IOC_IN) == __IOC_IN)
#define IOC_SIZE(cmd) (((unsigned)cmd & (0xff << 16)) >> 16)
/**
* The following macros are for user to define their own ioctls.
* These ioctls can be used by one or more user-defined protocols
* (line disciplines).
* Arguments:
* n: an integer between 0 and 127
* t: a type; e.g., int or struct x (sizeof(t) must be < 255)
* For example,
* 1. CIOR(0, int)
* 2. CIOW(1, struct x) where struct x is a user-defined structure
*/
#define CIO(n) _IO('C', n)
#define CIOR(n, t) _IOR('C', n, t)
#define CIOW(n, t) _IOW('C', n, t)
#define CIOWR(n, t) _IOWR('C', n, t)
/*
* Terminal ioctl requests
* (Certain tty ioctl's are in sgtty.h)
*/
#define TIOCGETD _IOR('t', 0, int) /* get line discipline */
#define TIOCSETD _IOW('t', 1, int) /* set line discipline */
#define TIOCHPCL _IO('t', 2) /* hang up on last close */
#define TIOCEXCL _IO('t', 13) /* set exclusive use of terminal */
#define TIOCNXCL _IO('t', 14) /* clear exclusive use of term. */
#define TIOCFLUSH _IOW('t', 16, int) /* discard buffer contents */
#define TIOCSENCODE _IOW('t', 94, int) /* set character encoding */
#define EN_ASCII 0x00000000 /* normal (default) */
#define EN_BS1 0x00010000 /* terminal back only 1 space */
#define EN_HANGUL 0x00000001 /* hangul */
#define EN_CHINESE 0x00000002 /* chinese */
#define TIOCGENCODE _IOR('t', 95, int) /* set character encoding */
#define TIOCCBRK _IO('t', 122) /* clear break condition - n.s. */
#define TIOCSBRK _IO('t', 123) /* set break condition - n.s. */
#define TIOCGWINSZ _IOR('t', 101, struct winsize) /* get window size */
#define TIOCSWINSZ _IOW('t', 102, struct winsize) /* set window size */
#define TIOCSPGRP_V _IOW('t', 103, int) /* check for own session */
#define TIOCGSID _IOR('t', 104, int) /* get session id */
#define TIOCSPGRP _IOW('t', 118, int) /* set process group */
#define TIOCGPGRP _IOR('t', 119, int) /* get process group */
#define TIOCNOTTY _IO('t', 113) /* remove control terminal */
#define TIOCSTI _IOW('t', 114, char)/* simulate terminal input */
#define TIOCOUTQ _IOR('t', 115, int) /* # of chars in output queue */
/*
* Ioctls for pseudo terminals only.
*/
#define TIOCSTART _IO('t', 110) /* start output */
#define TIOCSTOP _IO('t', 111) /* stop output */
#define TIOCPKT _IOW('t', 112, int) /* set/clear packet mode */
#define TIOCPKT_DATA 0x00 /* data packet */
#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
#define TIOCPKT_STOP 0x04 /* stop output */
#define TIOCPKT_START 0x08 /* start output */
#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 TIOCUCNTL _IOW('t', 100, int) /* set/clear user control mode*/
#define UIOCCMD(n) _IO('u', n) /* user control operation "n" */
#define TIOCREMOTE _IOR('t', 105, int) /* remote flow control */
#define TIOCEXT _IOW('t', 96, int) /* external proccessing - n.s.*/
#define TIOCSIG _IO('t', 97) /* generate signal - n.s. */
/*
* Modem control ioctls - not supported.
*/
#define TIOCMODG _IOR('t', 3, int) /* get modem control state */
#define TIOCMODS _IOW('t', 4, int) /* set modem control state */
#define TIOCM_LE 0001 /* line enable */
#define TIOCM_DTR 0002 /* data terminal ready */
#define TIOCM_RTS 0004 /* request to send */
#define TIOCM_ST 0010 /* secondary transmit */
#define TIOCM_SR 0020 /* secondary receive */
#define TIOCM_CTS 0040 /* clear to send */
#define TIOCM_CAR 0100 /* carrier detect */
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RNG 0200 /* ring */
#define TIOCM_RI TIOCM_RNG
#define TIOCM_DSR 0400 /* data set ready */
#define TIOCCDTR _IO('t', 120) /* modem control */
#define TIOCSDTR _IO('t', 121)
#define TIOCMGET _IOR('t',106,int)
#define TIOCMBIC _IOW('t',107,int)
#define TIOCMBIS _IOW('t',108,int)
#define TIOCMSET _IOW('t',109,int)
/*
* Ioctls for the termio/termios terminal interface.
*/
#define TCGETA _IOR('T', 1, struct termio) /* get termio structure */
#define TCSETA _IOW('T', 2, struct termio) /* set termio structure */
#define TCSETAW _IOW('T', 3, struct termio)
#define TCSETAF _IOW('T', 4, struct termio)
#define TCSBRK _IO('T', 5) /* wait for output to drain */
#define TCXONC _IO('T', 6) /* stop/start control */
#define TCOOFF 0 /* suspend output */
#define TCOON 1 /* restart suspended output */
#define TCIOFF 2 /* suspend input */
#define TCION 3 /* restart suspended input */
#define TCFLSH _IO('T', 7) /* discard input/output */
#define TCIFLUSH 0 /* flush input queue */
#define TCOFLUSH 1 /* flush output queue */
#define TCIOFLUSH 2 /* flush input/output queues */
#define TCCHGSES _IOW('T', 9, struct sesspec) /* change session */
#define TCGETTN _IOR('T', 10, char[10]) /* get RcLan terminal name */
#define TCGETS _IOR('T', 11, struct termios) /* get termios structure */
#define TCSETS _IOW('T', 12, struct termios) /* set termios structure */
#define TCSETSW _IOW('T', 13, struct termios)
#define TCSETSF _IOW('T', 14, struct termios)
#define TCSANOW TCSETS
#define TCSADRAIN TCSETSW
#define TCSAFLUSH TCSETSF
/*
* Line disciplines.
*/
#define NTTYDISC 2 /* new tty (standard) */
#define TABLDISC 3 /* tablet discipline - not supported */
#define SLIPDISC 4 /* serial IP discipline - not supported */
#define FIOCLEX _IO('f', 1) /* close terminal on exec */
#define FIONCLEX _IO('f', 2) /* don't close on exec */
#define FIONREAD _IOR('f', 127, int) /* get # of bytes on input queue */
#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking I/O */
#define FIOASYNC _IOW('f', 125, int) /* set/clear async I/O */
#define FIOSETOWN _IOW('f', 124, int) /* set owner */
#define FIOGETOWN _IOR('f', 123, int) /* get owner */
/*
* XVCPI ioctl() operations
*/
#define XIOGETSVC _IOR('x',0,struct xvc_getsvc)/* Get free svc file */
#define XIOINCALL _IOR('x',1,struct xvc_call) /* Get incomming call */
#define XIOCALL _IOWR('x',2,struct xvc_call) /* Outgiong call */
#define XIOACCEPT _IOW('x',3,struct xvc_call) /* Accept incomming call */
#define XIOCLEAR _IOWR('x',4,struct xvc_event) /* Clear stream */
#define XIOMASK _IOW('x',5,int) /* Change event mask */
#define XIOEVENT _IOR('x',6,struct xvc_event) /* Get event */
#define XIOINTRPT _IOW('x',7,struct xvc_event) /* Send interrupt */
#define XIORESET _IOW('x',8,struct xvc_event) /* Reset stream */
#define XIORACK _IO('x',9) /* Ack. incomming reset */
#define XIOSTAT _IOR('x',10,struct xvc_status)/*Get status information*/
/*
* Socket level ioctl() operations
*/
#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */
#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */
#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */
#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */
#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */
#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
#define SIOCADDRT _IOW('r', 10, struct rtentry) /* add route */
#define SIOCDELRT _IOW('r', 11, struct rtentry) /* delete route */
#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
#define SIOCGIFADDR _IOWR('i',13, struct ifreq) /* get ifnet address */
#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
#define SIOCGIFDSTADDR _IOWR('i',15, struct ifreq) /* get p-p address */
#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
#define SIOCGIFFLAGS _IOWR('i',17, struct ifreq) /* get ifnet flags */
#define SIOCGIFBRDADDR _IOWR('i',18, struct ifreq) /* get broadcast addr */
#define SIOCSIFBRDADDR _IOW('i',19, struct ifreq) /* set broadcast addr */
#define SIOCGIFCONF _IOWR('i',20, struct ifconf) /* get ifnet list */
#define SIOCGIFNETMASK _IOWR('i',21, struct ifreq) /* get net addr mask */
#define SIOCSIFNETMASK _IOW('i',22, struct ifreq) /* set net addr mask */
#define SIOCGIFMETRIC _IOWR('i',23, struct ifreq) /* get IF metric */
#define SIOCSIFMETRIC _IOW('i',24, struct ifreq) /* set IF metric */
#define SIOCGIFSTATUS _IOR('i',25, struct ifreq) /* get phys EN status */
#define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */
#define SIOCGARP _IOWR('i',31, struct arpreq) /* get arp entry */
#define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */
#define SIOCSIMCASYNC _IO('s', 23) /* set async sending (IMC) */
#define SIOCSIMCSYNC _IO('s', 24) /* set sync sending (IMC) */
/*
* Disk ioctl() commands
*/
#define DIOSETP _IOW('d', 0, struct diskparam) /* start format */
#define DIOWRDEFECT _IOW('d', 1, struct diskdefect) /* write defect list */
#define DIORDDEFECT _IOWR('d', 2, struct diskdefect)/* read defect list */
#define DIOFTRACK _IOWR('d', 3, struct diskftrack)/* format tracks */
#define DIOFDONE _IOR('d', 4, struct diskparam) /* end format */
#define DIOFPOLL _IOR('d', 5, struct diskftrack) /* poll format status */
#define DIOGETP _IOR('d', 6, struct diskparam) /* get disk parameter */
/*
* Logical volume ioctl() commands
*/
#define LVIOCLRLOG _IO('v', 0) /* clear log */
#define LVIOGETDUMP _IOR('v', 1, struct lviodump) /* get dump info */
#define LVIOSETDUMP _IOW('v', 2, struct lviodump) /* set dump info */
/*
* Window/terminal size structure.
* This information is stored by the kernel
* in order to provide a consistent interface,
* but is not used by the kernel.
*
* Type must be "unsigned short" so that types.h not required.
*/
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in characters */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
#endif __IOCTL