Re: [PATCH v8 05/15] linux: implement arbitrary and split speeds in termios
H. Peter Anvin
hpa@zytor.com
Wed Jun 11 14:37:51 GMT 2025
On June 11, 2025 12:11:45 AM PDT, Andreas Schwab <schwab@suse.de> wrote:
>On Jun 10 2025, H. Peter Anvin wrote:
>
>> diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h
>> index f02a197518b5..8dbe9f2ba89f 100644
>> --- a/sysdeps/unix/sysv/linux/kernel_termios.h
>> +++ b/sysdeps/unix/sysv/linux/kernel_termios.h
>> @@ -17,21 +17,29 @@
>>
>> #ifndef _KERNEL_TERMIOS_H
>> #define _KERNEL_TERMIOS_H 1
>> -/* The following corresponds to the values from the Linux 2.1.20 kernel. */
>> +/* The following corresponds to the values from the Linux 2.6.23 kernel. */
>>
>> -#define __KERNEL_NCCS 19
>> +#ifdef __mips__
>> +# define __KERNEL_NCCS 23
>> +#else
>> +# define __KERNEL_NCCS 19
>> +#endif
>>
>> -struct __kernel_termios
>> +struct termios2
>> {
>> tcflag_t c_iflag; /* input mode flags */
>> tcflag_t c_oflag; /* output mode flags */
>> tcflag_t c_cflag; /* control mode flags */
>> tcflag_t c_lflag; /* local mode flags */
>> +#if defined(__alpha__) || defined(__powerpc__)
>> + cc_t c_cc[__KERNEL_NCCS]; /* control characters */
>> + cc_t c_line; /* line discipline */
>> +#else
>> cc_t c_line; /* line discipline */
>> cc_t c_cc[__KERNEL_NCCS]; /* control characters */
>> +#endif
>> + speed_t c_ispeed; /* input speed */
>> + speed_t c_ospeed; /* output speed */
>> };
>>
>> -#define _HAVE_C_ISPEED 0
>> -#define _HAVE_C_OSPEED 0
>> -
>> #endif /* kernel_termios.h */
>
>Please don't use processor defines in generic files, instead we prefer
>to place the header in the appropriate processor subdirectory, for those
>that differ.
>
Any suggestions how to do that without having to replicate files unnecessarily?
More information about the Libc-alpha
mailing list