xref: /onnv-gate/usr/src/lib/libbc/inc/include/sys/ttycom.h (revision 722:636b850d4ee9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*722Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	__sys_ttycom_h
280Sstevel@tonic-gate #define	__sys_ttycom_h
290Sstevel@tonic-gate 
30*722Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*722Smuffin 
320Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
330Sstevel@tonic-gate 
340Sstevel@tonic-gate /*
350Sstevel@tonic-gate  * Window/terminal size structure.
360Sstevel@tonic-gate  * This information is stored by the kernel
370Sstevel@tonic-gate  * in order to provide a consistent interface,
380Sstevel@tonic-gate  * but is not used by the kernel.
390Sstevel@tonic-gate  *
400Sstevel@tonic-gate  * Type must be "unsigned short" so that types.h not required.
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate struct winsize {
430Sstevel@tonic-gate 	unsigned short	ws_row;		/* rows, in characters */
440Sstevel@tonic-gate 	unsigned short	ws_col;		/* columns, in characters */
450Sstevel@tonic-gate 	unsigned short	ws_xpixel;	/* horizontal size, pixels - not used */
460Sstevel@tonic-gate 	unsigned short	ws_ypixel;	/* vertical size, pixels - not used */
470Sstevel@tonic-gate };
480Sstevel@tonic-gate 
49*722Smuffin #define	TIOCGWINSZ	_IOR('t', 104, struct winsize)	/* get window size */
50*722Smuffin #define	TIOCSWINSZ	_IOW('t', 103, struct winsize)	/* set window size */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /*
530Sstevel@tonic-gate  * Sun version of same.
540Sstevel@tonic-gate  */
550Sstevel@tonic-gate struct ttysize {
560Sstevel@tonic-gate 	int	ts_lines;	/* number of lines on terminal */
570Sstevel@tonic-gate 	int	ts_cols;	/* number of columns on terminal */
580Sstevel@tonic-gate };
590Sstevel@tonic-gate 
60*722Smuffin #define	TIOCSSIZE	_IOW('t',37,struct ttysize)/* set tty size */
61*722Smuffin #define	TIOCGSIZE	_IOR('t',38,struct ttysize)/* get tty size */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * 4.3BSD and SunOS terminal "ioctl"s with no "termios" equivalents.
650Sstevel@tonic-gate  * This file is included by <sys/termios.h> and indirectly by <sys/ioctl.h>
660Sstevel@tonic-gate  * so that programs that include either one have these "ioctl"s defined.
670Sstevel@tonic-gate  */
68*722Smuffin #define	TIOCSCTTY	_IO('t', 132)		/* get a ctty */
69*722Smuffin #define	TIOCGPGRP	_IOR('t', 119, int)	/* get pgrp of tty */
70*722Smuffin #define	TIOCGETPGRP	_IOR('t', 131, int)	/* get pgrp of tty (posix) */
71*722Smuffin #define	TIOCSPGRP	_IOW('t', 118, int)	/* set pgrp of tty */
72*722Smuffin #define	TIOCSETPGRP	_IOW('t', 130, int)	/* set pgrp of tty (posix) */
73*722Smuffin #define	TIOCOUTQ	_IOR('t', 115, int)	/* output queue size */
74*722Smuffin #define	TIOCSTI		_IOW('t', 114, char)	/* simulate terminal input */
75*722Smuffin #define	TIOCNOTTY	_IO('t', 113)		/* void tty association */
76*722Smuffin #define	TIOCPKT		_IOW('t', 112, int)	/* pty: set/clear packet mode */
770Sstevel@tonic-gate #define		TIOCPKT_DATA		0x00	/* data packet */
780Sstevel@tonic-gate #define		TIOCPKT_FLUSHREAD	0x01	/* flush data not yet written to controller */
790Sstevel@tonic-gate #define		TIOCPKT_FLUSHWRITE	0x02	/* flush data read from controller but not yet processed */
800Sstevel@tonic-gate #define		TIOCPKT_STOP		0x04	/* stop output */
810Sstevel@tonic-gate #define		TIOCPKT_START		0x08	/* start output */
820Sstevel@tonic-gate #define		TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
830Sstevel@tonic-gate #define		TIOCPKT_DOSTOP		0x20	/* now do ^S, ^Q */
840Sstevel@tonic-gate #define		TIOCPKT_IOCTL		0x40	/* "ioctl" packet */
85*722Smuffin #define	TIOCMSET	_IOW('t', 109, int)	/* set all modem bits */
86*722Smuffin #define	TIOCMBIS	_IOW('t', 108, int)	/* bis modem bits */
87*722Smuffin #define	TIOCMBIC	_IOW('t', 107, int)	/* bic modem bits */
88*722Smuffin #define	TIOCMGET	_IOR('t', 106, int)	/* get all modem bits */
890Sstevel@tonic-gate #define		TIOCM_LE	0001		/* line enable */
900Sstevel@tonic-gate #define		TIOCM_DTR	0002		/* data terminal ready */
910Sstevel@tonic-gate #define		TIOCM_RTS	0004		/* request to send */
920Sstevel@tonic-gate #define		TIOCM_ST	0010		/* secondary transmit */
930Sstevel@tonic-gate #define		TIOCM_SR	0020		/* secondary receive */
940Sstevel@tonic-gate #define		TIOCM_CTS	0040		/* clear to send */
950Sstevel@tonic-gate #define		TIOCM_CAR	0100		/* carrier detect */
960Sstevel@tonic-gate #define		TIOCM_CD	TIOCM_CAR
970Sstevel@tonic-gate #define		TIOCM_RNG	0200		/* ring */
980Sstevel@tonic-gate #define		TIOCM_RI	TIOCM_RNG
990Sstevel@tonic-gate #define		TIOCM_DSR	0400		/* data set ready */
1000Sstevel@tonic-gate 
101*722Smuffin #define	TIOCREMOTE	_IOW('t', 105, int)	/* remote input editing */
102*722Smuffin #define	TIOCUCNTL	_IOW('t', 102, int)	/* pty: set/clr usr cntl mode */
1030Sstevel@tonic-gate 
1040Sstevel@tonic-gate /*
1050Sstevel@tonic-gate  * Sun-specific ioctls with no "termios" equivalents.
1060Sstevel@tonic-gate  */
107*722Smuffin #define	TIOCTCNTL	_IOW('t', 32, int)	/* pty: set/clr intercept ioctl mode */
108*722Smuffin #define	TIOCSIGNAL	_IOW('t', 33, int)	/* pty: send signal to slave */
109*722Smuffin #define	TIOCCONS	_IO('t', 36)		/* get console I/O */
110*722Smuffin #define	TIOCSSOFTCAR	_IOW('t', 101, int)	/* set soft carrier flag */
111*722Smuffin #define	TIOCGSOFTCAR	_IOR('t', 100, int)	/* get soft carrier flag */
112*722Smuffin #define	TIOCISPACE	_IOR('t', 128, int)	/* space left in input queue */
113*722Smuffin #define	TIOCISIZE	_IOR('t', 129, int)	/* size of input queue */
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate #endif	/* !_POSIX_SOURCE */
1160Sstevel@tonic-gate #endif	/* !__sys_ttycom_h */
117