mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibC: Add 'cfmakeraw()'
This commit is contained in:
parent
0c07c005b5
commit
9e2c37a8b2
Notes:
sideshowbarker
2024-07-18 22:14:57 +09:00
Author: https://github.com/alimpfard
Commit: 9e2c37a8b2
Pull-request: https://github.com/SerenityOS/serenity/pull/5325
Issue: https://github.com/SerenityOS/serenity/issues/90
Reviewed-by: https://github.com/BenWiederhake
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/sunverwerth
2 changed files with 13 additions and 0 deletions
|
@ -145,4 +145,16 @@ int cfsetospeed(struct termios* tp, speed_t speed)
|
||||||
}
|
}
|
||||||
__RETURN_WITH_ERRNO(ospeed, 0, -1);
|
__RETURN_WITH_ERRNO(ospeed, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cfmakeraw(struct termios* tp)
|
||||||
|
{
|
||||||
|
if (!tp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto& termios = *tp;
|
||||||
|
termios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
|
||||||
|
termios.c_lflag &= ~OPOST;
|
||||||
|
termios.c_cflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
||||||
|
termios.c_cflag |= CS8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ speed_t cfgetispeed(const struct termios*);
|
||||||
speed_t cfgetospeed(const struct termios*);
|
speed_t cfgetospeed(const struct termios*);
|
||||||
int cfsetispeed(struct termios*, speed_t);
|
int cfsetispeed(struct termios*, speed_t);
|
||||||
int cfsetospeed(struct termios*, speed_t);
|
int cfsetospeed(struct termios*, speed_t);
|
||||||
|
void cfmakeraw(struct termios*);
|
||||||
|
|
||||||
/* c_cc characters */
|
/* c_cc characters */
|
||||||
#define VINTR 0
|
#define VINTR 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue