WIP/RFC patch for Linux termios overhaul

H. Peter Anvin hpa@zytor.com
Wed Mar 26 12:32:56 GMT 2025


On March 26, 2025 2:28:26 AM PDT, Andreas Schwab <schwab@suse.de> wrote:
>On Mär 25 2025, H. Peter Anvin wrote:
>
>> 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?
>
>Those that need it.  All libc-internal references require those aliases.
>
>> 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...
>
>The visibility is irrelevant for a static link.
>

I guess I'm asking if I need to change any of them to use the double-underscore versions. E.g. why __tcgetattr but tcsetattr?


More information about the Libc-alpha mailing list