@@ -9,7 +9,15 @@ static char *rcsid="@(#)$Id$";
9
9
#include <sys/termios.h>
10
10
#include <sys/ioctl.h>
11
11
#ifndef Darwin
12
- #include <termio.h>
12
+ #include <features.h>
13
+ #if defined(__GLIBC__ ) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 42 ))
14
+ #warning "Since glibc 2.42, termio.h is no longer supported. Dropping TCGETA TCSETA TCSETAW TCSETAF"
15
+ #define USE_TERMIOS
16
+ #include <termios.h>
17
+ #else
18
+ #define USE_TERMIO
19
+ #include <termio.h>
20
+ #endif
13
21
#endif
14
22
/* #include <sgtty.h> */
15
23
@@ -200,6 +208,7 @@ pointer argv[];
200
208
{ return (ioctl_struct (n ,argv ,TCSETSF ,sizeof (struct termios )));}
201
209
#endif
202
210
211
+ #ifdef USE_TERMIO
203
212
pointer IOCTL_TCGETA (ctx ,n ,argv )
204
213
register context * ctx ;
205
214
int n ;
@@ -223,6 +232,7 @@ int n;
223
232
pointer argv [];
224
233
{ return (ioctl_struct (n ,argv ,TCSETAW ,sizeof (struct termio )));}
225
234
#endif
235
+ #endif
226
236
227
237
pointer TCGETATTR (ctx ,n ,argv )
228
238
register context * ctx ;
@@ -281,10 +291,12 @@ register pointer mod;
281
291
defunpkg (ctx ,"TCSETSW" ,mod ,IOCTL_TCSETSW ,unixpkg );
282
292
defunpkg (ctx ,"TCSETSF" ,mod ,IOCTL_TCSETSF ,unixpkg );
283
293
#endif
294
+ #ifdef USE_TERMIO
284
295
defunpkg (ctx ,"TCGETA" ,mod ,IOCTL_TCGETA ,unixpkg );
285
296
defunpkg (ctx ,"TCSETA" ,mod ,IOCTL_TCSETA ,unixpkg );
286
297
defunpkg (ctx ,"TCSETAW" ,mod ,(pointer (* )(context * ,int ,pointer * ))IOCTL_TCSETAW ,unixpkg );
287
298
defunpkg (ctx ,"TCSETAF" ,mod ,IOCTL_TCSETAF ,unixpkg );
299
+ #endif
288
300
#endif
289
301
defunpkg (ctx ,"TCGETATTR" ,mod ,TCGETATTR ,unixpkg );
290
302
defunpkg (ctx ,"TCSETATTR" ,mod ,TCSETATTR ,unixpkg );
0 commit comments