]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux/termio: remove <termio.h> and struct termio
authorH. Peter Anvin <hpa@zytor.com>
Fri, 25 Apr 2025 05:30:59 +0000 (07:30 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 25 Apr 2025 05:30:59 +0000 (07:30 +0200)
The <termio.h> interface is absolutely ancient: it was obsoleted by
<termios.h> already in the first version of POSIX (1988) and thus
predates the very first version of Linux. Unfortunately, some constant
macros are used both by <termio.h> and <termios.h>; particularly
problematic is the baud rate constants since the termio interface
*requires* that the baud rate is set via an enumeration as part of
c_cflag.

In preparation of revamping the termios interface to support the
arbitrary baud rate capability that the Linux kernel has supported
since 2008, remove <termio.h> in the hope that no one still uses this
archaic interface.

Note that there is no actual code in glibc to support termio: it is
purely an unabstracted ioctl() interface.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
NEWS
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/bits/ioctl-types.h
sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
sysdeps/unix/sysv/linux/termio.h [deleted file]

diff --git a/NEWS b/NEWS
index 740225ad1294c88f9aac8ecfd95d9dc003ed3326..df7268e5d0afc89dd9ac6c468f0cedd44d865080 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,11 @@ Deprecated and removed features, and other changes affecting compatibility:
   programs that require an executable stack through dynamic loaded
   shared libraries.
 
+* On Linux, the <termio.h> header and the definition of struct termio
+  in <sys/ioctl.h> have been removed. The termio interface has been
+  obsolete since the very first version of POSIX.1 in 1988, replaced
+  with <termios.h>.
+
 Changes to build and runtime requirements:
 
 * GCC 12.1 or later is now required to build the GNU C Library.
index dcd87b295e8d27c62e7cf04a19a43ceeeaaf6a55..ebcf820403ff81faf9decc9b82112c7c13904a97 100644 (file)
@@ -506,12 +506,6 @@ sysdep_headers += \
   # sysdep_headers
 endif
 
-ifeq ($(subdir),termios)
-sysdep_headers += \
-  termio.h \
-  # sysdep_headers
-endif
-
 ifeq ($(subdir),posix)
 sysdep_headers += \
   bits/initspin.h \
index cc2c9d7af4ba96b57bd6e413cb890902d2360d04..e8e5084f1e1172a91c3ce171a6a2d89badb995e4 100644 (file)
@@ -32,17 +32,6 @@ struct winsize
     unsigned short int ws_ypixel;
   };
 
-#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 */
-};
-
 /* modem lines */
 #define TIOCM_LE       0x001
 #define TIOCM_DTR      0x002
index 03ebf1edbedb6b34a62314310ee5f20a6e901f88..84bb6fc6ef428158f51e1d25f00d694954dc582a 100644 (file)
@@ -31,18 +31,6 @@ struct winsize
     unsigned short int ws_ypixel;
   };
 
-#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 */
-    char c_line;                       /* line discipline */
-    /* Yes, this is really NCCS.  */
-    unsigned char c_cc[32 /* NCCS */]; /* control characters */
-  };
-
 /* modem lines */
 #define TIOCM_LE       0x001           /* line enable */
 #define TIOCM_DTR      0x002           /* data terminal ready */
index f2b360c57d7343ff7f8579a238109893c21bc8e4..267fa0970530b1f8c07c13303fdfc5475626fe3f 100644 (file)
@@ -32,17 +32,6 @@ struct winsize
     unsigned short int ws_ypixel;
   };
 
-#define NCC 10
-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 */
-};
-
 /* modem lines */
 #define TIOCM_LE       0x001
 #define TIOCM_DTR      0x002
diff --git a/sysdeps/unix/sysv/linux/termio.h b/sysdeps/unix/sysv/linux/termio.h
deleted file mode 100644 (file)
index 0e610f0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Compatible <termio.h> for old `struct termio' ioctl interface.
-   This is obsolete; use the POSIX.1 `struct termios' interface
-   defined in <termios.h> instead.  */
-
-#include <termios.h>
-#include <sys/ioctl.h>