1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #ifndef _SYS_TERMIOS_H_
36 #define _SYS_TERMIOS_H_
37
38 #include <sys/cdefs.h>
39
40
41
42
43
44
45
46
47 #define VEOF 0
48 #define VEOL 1
49 #if __BSD_VISIBLE
50 #define VEOL2 2
51 #endif
52 #define VERASE 3
53 #if __BSD_VISIBLE
54 #define VWERASE 4
55 #endif
56 #define VKILL 5
57 #if __BSD_VISIBLE
58 #define VREPRINT 6
59 #endif
60
61 #define VINTR 8
62 #define VQUIT 9
63 #define VSUSP 10
64 #if __BSD_VISIBLE
65 #define VDSUSP 11
66 #endif
67 #define VSTART 12
68 #define VSTOP 13
69 #if __BSD_VISIBLE
70 #define VLNEXT 14
71 #define VDISCARD 15
72 #endif
73 #define VMIN 16
74 #define VTIME 17
75 #if __BSD_VISIBLE
76 #define VSTATUS 18
77
78 #endif
79 #define NCCS 20
80
81 #define _POSIX_VDISABLE (0377)
82
83 #if __BSD_VISIBLE
84 #define CCEQ(val, c) (c == val ? val != _POSIX_VDISABLE : 0)
85 #endif
86
87
88
89
90 #define IGNBRK 0x00000001
91 #define BRKINT 0x00000002
92 #define IGNPAR 0x00000004
93 #define PARMRK 0x00000008
94 #define INPCK 0x00000010
95 #define ISTRIP 0x00000020
96 #define INLCR 0x00000040
97 #define IGNCR 0x00000080
98 #define ICRNL 0x00000100
99 #define IXON 0x00000200
100 #define IXOFF 0x00000400
101 #if __BSD_VISIBLE
102 #define IXANY 0x00000800
103 #define IUCLC 0x00001000
104 #define IMAXBEL 0x00002000
105 #endif
106
107
108
109
110 #define OPOST 0x00000001
111 #if __XPG_VISIBLE
112 #define ONLCR 0x00000002
113 #endif
114 #if __BSD_VISIBLE
115 #define OXTABS 0x00000004
116 #define ONOEOT 0x00000008
117 #endif
118 #if __XPG_VISIBLE
119 #define OCRNL 0x00000010
120 #define OLCUC 0x00000020
121 #define ONOCR 0x00000040
122 #define ONLRET 0x00000080
123 #endif
124
125
126
127
128 #if __BSD_VISIBLE
129 #define CIGNORE 0x00000001
130 #endif
131 #define CSIZE 0x00000300
132 #define CS5 0x00000000
133 #define CS6 0x00000100
134 #define CS7 0x00000200
135 #define CS8 0x00000300
136 #define CSTOPB 0x00000400
137 #define CREAD 0x00000800
138 #define PARENB 0x00001000
139 #define PARODD 0x00002000
140 #define HUPCL 0x00004000
141 #define CLOCAL 0x00008000
142 #if __BSD_VISIBLE
143 #define CRTSCTS 0x00010000
144 #define CRTS_IFLOW CRTSCTS
145 #define CCTS_OFLOW CRTSCTS
146 #define MDMBUF 0x00100000
147 #define CHWFLOW (MDMBUF|CRTSCTS)
148 #endif
149
150
151
152
153
154
155
156
157
158 #if __BSD_VISIBLE
159 #define ECHOKE 0x00000001
160 #endif
161 #define ECHOE 0x00000002
162 #define ECHOK 0x00000004
163 #define ECHO 0x00000008
164 #define ECHONL 0x00000010
165 #if __BSD_VISIBLE
166 #define ECHOPRT 0x00000020
167 #define ECHOCTL 0x00000040
168 #endif
169 #define ISIG 0x00000080
170 #define ICANON 0x00000100
171 #if __BSD_VISIBLE
172 #define ALTWERASE 0x00000200
173 #endif
174 #define IEXTEN 0x00000400
175 #define EXTPROC 0x00000800
176 #define TOSTOP 0x00400000
177 #if __BSD_VISIBLE
178 #define FLUSHO 0x00800000
179 #define XCASE 0x01000000
180 #define NOKERNINFO 0x02000000
181 #define PENDIN 0x20000000
182 #endif
183 #define NOFLSH 0x80000000
184
185 typedef unsigned int tcflag_t;
186 typedef unsigned char cc_t;
187 typedef unsigned int speed_t;
188
189 struct termios {
190 tcflag_t c_iflag;
191 tcflag_t c_oflag;
192 tcflag_t c_cflag;
193 tcflag_t c_lflag;
194 cc_t c_cc[NCCS];
195 int c_ispeed;
196 int c_ospeed;
197 };
198
199
200
201
202 #define TCSANOW 0
203 #define TCSADRAIN 1
204 #define TCSAFLUSH 2
205 #if __BSD_VISIBLE
206 #define TCSASOFT 0x10
207 #endif
208
209
210
211
212 #define B0 0
213 #define B50 50
214 #define B75 75
215 #define B110 110
216 #define B134 134
217 #define B150 150
218 #define B200 200
219 #define B300 300
220 #define B600 600
221 #define B1200 1200
222 #define B1800 1800
223 #define B2400 2400
224 #define B4800 4800
225 #define B9600 9600
226 #define B19200 19200
227 #define B38400 38400
228 #if __BSD_VISIBLE
229 #define B7200 7200
230 #define B14400 14400
231 #define B28800 28800
232 #define B57600 57600
233 #define B76800 76800
234 #define B115200 115200
235 #define B230400 230400
236 #define EXTA 19200
237 #define EXTB 38400
238 #endif
239
240 #ifndef _KERNEL
241
242 #define TCIFLUSH 1
243 #define TCOFLUSH 2
244 #define TCIOFLUSH 3
245 #define TCOOFF 1
246 #define TCOON 2
247 #define TCIOFF 3
248 #define TCION 4
249
250 #include <sys/cdefs.h>
251
252 __BEGIN_DECLS
253 speed_t cfgetispeed(const struct termios *);
254 speed_t cfgetospeed(const struct termios *);
255 int cfsetispeed(struct termios *, speed_t);
256 int cfsetospeed(struct termios *, speed_t);
257 int tcgetattr(int, struct termios *);
258 int tcsetattr(int, int, const struct termios *);
259 int tcdrain(int);
260 int tcflow(int, int);
261 int tcflush(int, int);
262 int tcsendbreak(int, int);
263
264 #if __BSD_VISIBLE
265 void cfmakeraw(struct termios *);
266 int cfsetspeed(struct termios *, speed_t);
267 #endif
268 __END_DECLS
269
270 #endif
271
272 #if __BSD_VISIBLE
273
274
275
276
277
278 #include <sys/ttycom.h>
279 #endif
280
281
282
283
284 #endif
285
286 #if __BSD_VISIBLE
287 #include <sys/ttydefaults.h>
288 #endif