xref: /illumos-gate/usr/src/cmd/ast/libast/amd64/FEATURE/tty (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1*b30d1939SAndy Fiddaman/* : : generated from contrib/ast/src/lib/libast/features/tty by iffe version 2012-07-17 : : */
2*b30d1939SAndy Fiddaman#ifndef _def_tty_ast
3*b30d1939SAndy Fiddaman#define _def_tty_ast	1
4*b30d1939SAndy Fiddaman#define _sys_types	1	/* #include <sys/types.h> ok */
5*b30d1939SAndy Fiddaman#define _hdr_termios	1	/* #include <termios.h> ok */
6*b30d1939SAndy Fiddaman#define _hdr_termio	1	/* #include <termio.h> ok */
7*b30d1939SAndy Fiddaman#define _hdr_sgtty	1	/* #include <sgtty.h> ok */
8*b30d1939SAndy Fiddaman#define _sys_termios	1	/* #include <sys/termios.h> ok */
9*b30d1939SAndy Fiddaman#define _sys_termio	1	/* #include <sys/termio.h> ok */
10*b30d1939SAndy Fiddaman#define _sys_ioctl	1	/* #include <sys/ioctl.h> ok */
11*b30d1939SAndy Fiddaman#define _lib_tcgetattr	1	/* tcgetattr() in default lib(s) */
12*b30d1939SAndy Fiddaman#define _lib_tcgetpgrp	1	/* tcgetpgrp() in default lib(s) */
13*b30d1939SAndy Fiddaman#define _mac__POSIX_VDISABLE	1	/* _POSIX_VDISABLE is a macro */
14*b30d1939SAndy Fiddaman
15*b30d1939SAndy Fiddaman#ifdef _hdr_termios
16*b30d1939SAndy Fiddaman#   if _mac__POSIX_VDISABLE
17*b30d1939SAndy Fiddaman#	undef _POSIX_VDISABLE
18*b30d1939SAndy Fiddaman#   endif
19*b30d1939SAndy Fiddaman#   include	<termios.h>
20*b30d1939SAndy Fiddaman#else
21*b30d1939SAndy Fiddaman#   if defined(_sys_termios) && defined(_lib_tcgetattr)
22*b30d1939SAndy Fiddaman#	include	<sys/termios.h>
23*b30d1939SAndy Fiddaman#	define _hdr_termios	1
24*b30d1939SAndy Fiddaman#   else
25*b30d1939SAndy Fiddaman#	undef _sys_termios
26*b30d1939SAndy Fiddaman#   endif /* _sys_termios */
27*b30d1939SAndy Fiddaman#endif /* _hdr_termios */
28*b30d1939SAndy Fiddaman
29*b30d1939SAndy Fiddaman#ifdef _hdr_termios
30*b30d1939SAndy Fiddaman#   undef _hdr_sgtty
31*b30d1939SAndy Fiddaman#   undef tcgetattr
32*b30d1939SAndy Fiddaman#   undef tcsetattr
33*b30d1939SAndy Fiddaman#   undef tcgetpgrp
34*b30d1939SAndy Fiddaman#   undef tcsetpgrp
35*b30d1939SAndy Fiddaman#   undef cfgetospeed
36*b30d1939SAndy Fiddaman#   ifndef TCSANOW
37*b30d1939SAndy Fiddaman#	define TCSANOW		TCSETS
38*b30d1939SAndy Fiddaman#	define TCSADRAIN	TCSETSW
39*b30d1939SAndy Fiddaman#	define TCSAFLUSH	TCSETSF
40*b30d1939SAndy Fiddaman#   endif /* TCSANOW */
41*b30d1939SAndy Fiddaman   /* The following corrects bugs in some implementations */
42*b30d1939SAndy Fiddaman#   if defined(TCSADFLUSH) && !defined(TCSAFLUSH)
43*b30d1939SAndy Fiddaman#	define TCSAFLUSH	TCSADFLUSH
44*b30d1939SAndy Fiddaman#   endif /* TCSADFLUSH */
45*b30d1939SAndy Fiddaman#   ifndef _lib_tcgetattr
46*b30d1939SAndy Fiddaman#	undef  tcgetattr
47*b30d1939SAndy Fiddaman#	define tcgetattr(fd,tty)	ioctl(fd, TCGETS, tty)
48*b30d1939SAndy Fiddaman#	undef  tcsetattr
49*b30d1939SAndy Fiddaman#	define tcsetattr(fd,action,tty)	ioctl(fd, action, tty)
50*b30d1939SAndy Fiddaman#	undef  cfgetospeed
51*b30d1939SAndy Fiddaman#	define cfgetospeed(tp)		((tp)->c_cflag & CBAUD)
52*b30d1939SAndy Fiddaman#   endif /* _lib_tcgetattr */
53*b30d1939SAndy Fiddaman#   undef TIOCGETC
54*b30d1939SAndy Fiddaman#else
55*b30d1939SAndy Fiddaman#   define cfgetospeed(tp)	((tp)->c_cflag & CBAUD)
56*b30d1939SAndy Fiddaman#   define cfgetispeed(tp)	((tp)->c_cflag & CBAUD)
57*b30d1939SAndy Fiddaman#   define cfsetispeed(tp,val)	((tp)->c_cflag &=~ CBAUD,(tp)->c_cflag|=(val))
58*b30d1939SAndy Fiddaman#   define cfsetospeed(tp,val)	((tp)->c_cflag &=~ CBAUD,(tp)->c_cflag|=(val))
59*b30d1939SAndy Fiddaman#   ifdef _hdr_termio
60*b30d1939SAndy Fiddaman#	include	<termio.h>
61*b30d1939SAndy Fiddaman#   else
62*b30d1939SAndy Fiddaman#	ifdef _sys_termio
63*b30d1939SAndy Fiddaman#	    include	<sys/termio.h>
64*b30d1939SAndy Fiddaman#	    define _hdr_termio 1
65*b30d1939SAndy Fiddaman#	endif /* _sys_termio */
66*b30d1939SAndy Fiddaman#   endif /* _hdr_termio */
67*b30d1939SAndy Fiddaman#   ifdef _hdr_termio
68*b30d1939SAndy Fiddaman#	define termios termio
69*b30d1939SAndy Fiddaman#	undef TIOCGETC
70*b30d1939SAndy Fiddaman#	define tcgetattr(fd,tty)	ioctl(fd, TCGETA, tty)
71*b30d1939SAndy Fiddaman#	define tcsetattr(fd,action,tty)	ioctl(fd, action, tty)
72*b30d1939SAndy Fiddaman
73*b30d1939SAndy Fiddaman#	ifdef _sys_bsdtty
74*b30d1939SAndy Fiddaman#	   include	<sys/bsdtty.h>
75*b30d1939SAndy Fiddaman#	endif /* _sys_bsdtty */
76*b30d1939SAndy Fiddaman#   else
77*b30d1939SAndy Fiddaman#	ifdef _hdr_sgtty
78*b30d1939SAndy Fiddaman#	    include	<sgtty.h>
79*b30d1939SAndy Fiddaman#	    ifndef LPENDIN
80*b30d1939SAndy Fiddaman#	        ifdef _sys_nttyio
81*b30d1939SAndy Fiddaman#		    include	<sys/nttyio.h>
82*b30d1939SAndy Fiddaman#	        endif /* _sys_nttyio */
83*b30d1939SAndy Fiddaman#	    endif /* LPENDIN */
84*b30d1939SAndy Fiddaman#	    define termios sgttyb
85*b30d1939SAndy Fiddaman#	    ifdef TIOCSETN
86*b30d1939SAndy Fiddaman#	 	undef TCSETAW
87*b30d1939SAndy Fiddaman#	    endif /* TIOCSETN */
88*b30d1939SAndy Fiddaman#	    ifdef TIOCGETP
89*b30d1939SAndy Fiddaman#		define tcgetattr(fd,tty)	ioctl(fd, TIOCGETP, tty)
90*b30d1939SAndy Fiddaman#		define tcsetattr(fd,action,tty)	ioctl(fd, action, tty)
91*b30d1939SAndy Fiddaman#	    else
92*b30d1939SAndy Fiddaman#		define tcgetattr(fd,tty)	gtty(fd, tty)
93*b30d1939SAndy Fiddaman#		define tcsetattr(fd,action,tty)	stty(fd, tty)
94*b30d1939SAndy Fiddaman#	    endif /* TIOCGETP */
95*b30d1939SAndy Fiddaman#	else
96*b30d1939SAndy Fiddaman#		ifdef _sys_ttyio
97*b30d1939SAndy Fiddaman#			include <sys/ttyio.h>
98*b30d1939SAndy Fiddaman#		endif
99*b30d1939SAndy Fiddaman#	endif /* _hdr_sgtty */
100*b30d1939SAndy Fiddaman#   endif /* hdr_termio */
101*b30d1939SAndy Fiddaman
102*b30d1939SAndy Fiddaman#   ifndef TCSANOW
103*b30d1939SAndy Fiddaman#	ifdef TCSETAW
104*b30d1939SAndy Fiddaman#	    define TCSANOW		TCSETA
105*b30d1939SAndy Fiddaman#	    define TCSAFLUSH		TCSETAF
106*b30d1939SAndy Fiddaman#	else
107*b30d1939SAndy Fiddaman#	    ifdef TIOCSETN
108*b30d1939SAndy Fiddaman#		define TCSANOW		TIOCSETN
109*b30d1939SAndy Fiddaman#		define TCSADRAIN	TIOCSETN
110*b30d1939SAndy Fiddaman#		define TCSAFLUSH	TIOCSETP
111*b30d1939SAndy Fiddaman#	    endif /* TIOCSETN */
112*b30d1939SAndy Fiddaman#	endif /* TCSETAW */
113*b30d1939SAndy Fiddaman#   endif /* TCSANOW */
114*b30d1939SAndy Fiddaman#endif /* _hdr_termios */
115*b30d1939SAndy Fiddaman
116*b30d1939SAndy Fiddaman/* set ECHOCTL if driver can echo control charaters as ^c */
117*b30d1939SAndy Fiddaman#ifdef LCTLECH
118*b30d1939SAndy Fiddaman#   ifndef ECHOCTL
119*b30d1939SAndy Fiddaman#	define ECHOCTL	LCTLECH
120*b30d1939SAndy Fiddaman#   endif /* !ECHOCTL */
121*b30d1939SAndy Fiddaman#endif /* LCTLECH */
122*b30d1939SAndy Fiddaman#ifdef LNEW_CTLECH
123*b30d1939SAndy Fiddaman#   ifndef ECHOCTL
124*b30d1939SAndy Fiddaman#	define ECHOCTL  LNEW_CTLECH
125*b30d1939SAndy Fiddaman#   endif /* !ECHOCTL */
126*b30d1939SAndy Fiddaman#endif /* LNEW_CTLECH */
127*b30d1939SAndy Fiddaman#ifdef LNEW_PENDIN
128*b30d1939SAndy Fiddaman#   ifndef PENDIN
129*b30d1939SAndy Fiddaman#	define PENDIN LNEW_PENDIN
130*b30d1939SAndy Fiddaman#  endif /* !PENDIN */
131*b30d1939SAndy Fiddaman#endif /* LNEW_PENDIN */
132*b30d1939SAndy Fiddaman
133*b30d1939SAndy Fiddaman
134*b30d1939SAndy Fiddaman#endif
135