Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc_unix.go: Make cfmakeraw compatible to Linux #77

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

ktock
Copy link
Member

@ktock ktock commented Jun 20, 2023

According to termios(3), cfmakeraw should perform or on c_cflag with CS8.
But the current our cfmakeraw implementation doesn't do that but clears that bit.
This commit fixes cfmakeraw to make it behave same as Linux's one.

https://man7.org/linux/man-pages/man3/termios.3.html

           termios_p->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
                           | INLCR | IGNCR | ICRNL | IXON);
           termios_p->c_oflag &= ~OPOST;
           termios_p->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
           termios_p->c_cflag &= ~(CSIZE | PARENB);
           termios_p->c_cflag |= CS8;

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
@andrewsun2898
Copy link

Quick ping on this. We're running into some issues with switching into raw mode that should be fixed with this pr. Can we get this submitted?

@estesp estesp merged commit 8f6c4e4 into containerd:main Jul 6, 2023
1 check passed
@ktock ktock deleted the cfmakeraw branch July 7, 2023 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants