Skip to content

pty: Implement TCSBRK and TCFLSH#12914

Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:pty-tcsbrk-tcflsh
Apr 10, 2026
Merged

pty: Implement TCSBRK and TCFLSH#12914
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:pty-tcsbrk-tcflsh

Conversation

@tanyifeng
Copy link
Copy Markdown
Contributor

Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by flushing the input and/or output queues. gVisor returned ENOTTY, which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through lineDiscipline.tcFlush(), including packet mode flush notification and queue wakeups, to match Linux PTY semantics.

Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by
flushing the input and/or output queues. gVisor returned ENOTTY,
which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through
lineDiscipline.tcFlush(), including packet mode flush notification
and queue wakeups, to match Linux PTY semantics.

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
copybara-service Bot pushed a commit that referenced this pull request Apr 10, 2026
Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by flushing the input and/or output queues. gVisor returned ENOTTY, which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through lineDiscipline.tcFlush(), including packet mode flush notification and queue wakeups, to match Linux PTY semantics.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12914 from tanyifeng:pty-tcsbrk-tcflsh e00ca0a
PiperOrigin-RevId: 897772400
copybara-service Bot pushed a commit that referenced this pull request Apr 10, 2026
Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by flushing the input and/or output queues. gVisor returned ENOTTY, which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through lineDiscipline.tcFlush(), including packet mode flush notification and queue wakeups, to match Linux PTY semantics.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12914 from tanyifeng:pty-tcsbrk-tcflsh e00ca0a
PiperOrigin-RevId: 897772400
@copybara-service copybara-service Bot merged commit c83005f into google:master Apr 10, 2026
6 checks passed
maci0 pushed a commit to maci0/gvisor that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants