Add additional termios.h mappings

```cpp
include <bits/termios-c_lflag.h>  // for ECHO
include <bits/termios-struct.h>   // for termios
include <bits/termios-tcflow.h>   // for TCSANOW

void SetStdinEcho(bool enable)
{
    struct termios tty;
    tcgetattr(STDIN_FILENO, &tty);
    if (!enable) {
        tty.c_lflag &= ~ECHO;
    } else {
        tty.c_lflag |= ECHO;
    }
    (void)tcsetattr(STDIN_FILENO, TCSANOW, &tty);
}
```
This commit is contained in:
fanquake 2022-04-12 10:18:07 +01:00 committed by Kim Gräsman
parent 046ca22380
commit d3e7eb40b4
2 changed files with 6 additions and 0 deletions

View File

@ -97,6 +97,9 @@
{ include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/termios.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/time.h>", private, "<time.h>", public ] },
{ include: [ "<bits/time.h>", private, "<sys/time.h>", public ] },
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },

View File

@ -452,6 +452,9 @@ const IncludeMapEntry libc_include_map[] = {
{ "<bits/syslog-ldbl.h>", kPrivate, "<sys/syslog.h>", kPrivate },
{ "<bits/syslog-path.h>", kPrivate, "<sys/syslog.h>", kPrivate },
{ "<bits/syslog.h>", kPrivate, "<sys/syslog.h>", kPrivate },
{ "<bits/termios-c_lflag.h>", kPrivate, "<termios.h>", kPublic },
{ "<bits/termios-struct.h>", kPrivate, "<termios.h>", kPublic },
{ "<bits/termios-tcflow.h>", kPrivate, "<termios.h>", kPublic },
{ "<bits/termios.h>", kPrivate, "<termios.h>", kPublic },
{ "<bits/time.h>", kPrivate, "<time.h>", kPublic },
{ "<bits/time.h>", kPrivate, "<sys/time.h>", kPublic },