From de6067ee5396b9214ee1ae41d39d5c1eb1f5c2c7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 14 Jan 2026 23:39:02 +0100 Subject: [PATCH] Add backward compatiblity code for . The backward compatibility code for has been removed starting from GLIBC 2.42. So it starts to fail on some bleeding edge distributions like openSUSE Tumbleweed. We took back the code removed from the GLIBC and put it back inside txInput.c. --- textio/txInput.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/textio/txInput.c b/textio/txInput.c index 5ecb63b8a..d56704f07 100644 --- a/textio/txInput.c +++ b/textio/txInput.c @@ -30,6 +30,29 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ #include #include #include +#ifdef __GLIBC__ +# if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 42) + +/* Code borrowed from the GLIBC 2.41 */ +# include +# include + +/* From unix/sysv/linux/bits/ioctl-types.h */ +#define NCC 8 +struct termio + { + unsigned short int c_iflag; /* input mode flags */ + unsigned short int c_oflag; /* output mode flags */ + unsigned short int c_cflag; /* control mode flags */ + unsigned short int c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +# else +# include +# endif +#endif #include "utils/magsgtty.h"