1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Linux: Keep termios ioctl constants strictly internal

Undefine TCGETS, TCGETS2, and related ioctl constants in the installed
headers.  Extract the correct constants (using the kernel type
definitions) automatically from the UAPI headers.  The kernel
constants are available under KERNEL_* names during the glibc build,
computed using assembler constant extraction mechanism.

Alpha may have to use TCGETS instead of TCGETS2 because TCTGETS2
became available in Linux 4.20 only.  Introduce ARCH_TCGETS to make
this choice explict.

To support emulation on powerpc, glibc versions of the termios
constants are added to the emulation code in internal-ioctl.h.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2025-07-11 16:04:07 +02:00
parent 02e7ac5ee3
commit 3d3572f590
18 changed files with 116 additions and 260 deletions

View File

@@ -22,4 +22,18 @@
/* Use the definitions from the kernel header files. */
#include <asm/ioctls.h>
/* The GNU C library has a different definition of struct termios,
incompatible with what the ioctl interface expects. The existence
of the termios2 ioctls is considered an implementation detail.
Undefine all related ioctl constants. */
#undef TCGETS
#undef TCSETS
#undef TCSETSF
#undef TCSETSW
#undef TCGETS2
#undef TCSETS2
#undef TCSETSF2
#undef TCSETSW2
#include <linux/sockios.h>