WIP/RFC patch for Linux termios overhaul

H. Peter Anvin hpa@zytor.com
Mon Mar 31 21:02:09 GMT 2025


On 3/25/25 17:19, H. Peter Anvin wrote:
> On 3/25/25 13:40, H. Peter Anvin wrote:
>> It is not even tested, never mind productized, but I would love to get 
>> some feedback on this approach and implementation.
>>
>> https://git.zytor.com/linux/glibc.git/commit/?h=hpa/termios
>>
>>      -hpa
>>
> 
> My biggest confusion at this point is the libc_hidden_proto () 
> definitions in <include/termios.h>:
> 
> /* Now define the internal interfaces.  */
> extern int __tcgetattr (int __fd, struct termios *__termios_p);
> extern int __tcsetattr (int __fd, int __optional_actions,
>                          const struct termios *__termios_p);
> 
> extern int __libc_tcdrain (int __fd);
> 
> libc_hidden_proto (__tcgetattr)
> libc_hidden_proto (tcsetattr)
> libc_hidden_proto (cfsetispeed)
> libc_hidden_proto (cfsetospeed)
> 
> This seems... random?! which ones are declared that way?
> 
> The result in my case is that the alias symbols for cfset[io]speed() end 
> up marked hidden in libc.a, whereas cfget[io]speed() are not. This seems 
> broken...
>

For the record: I had to change these to actually refer to the __ names 
that are also defined in the header file itself, or one or more of the 
architectures would not build with the versioned interfaces.

That also seems like The Right Thing[TM].

	-hpa



More information about the Libc-alpha mailing list