[PATCH] Linux: Define struct termios2 and its ioctls on all architectures

Florian Weimer fweimer@redhat.com
Wed Jul 9 14:08:16 GMT 2025


* Andreas Schwab:

> On Jul 09 2025, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> I think installed glibc headers should not define any termios2 ioctl
>>> numbers anywhere.  Most users should be using the POSIX termios
>>> interfaces, and code that needs to bypass glibc to interface with the
>>> ioctl syscall directly (strace, seccomp, etc.) must use the definitions
>>> from the kernel headers anyway.
>>
>> I assume this also applies to the termios ioctls?
>
> I'm only talking about the termios2 interface, which is the subject of
> this thread.  glibc has never provided any definitions for it and should
> continue to do so, since it is an implementation detail.

What I find especially jarring about the current situation is that the
headers wee install expose the kernel's TCGETS constant (and others),
but our definition of struct termios is not compatible with that.

I thought there was some rationale behind doing it that way, so my patch
tried to expose a working termios2 ioctl interface.

If we don't see value in exposing the termios2 ioctls, I think we should
not expose the termios (1) ioctls, either.  Especially since our struct
termios is incompatible.

That's why I don't think this thread is exclusively about termios2.

Thanks,
Florian



More information about the Libc-alpha mailing list