Skip to content

Conversation

mmastrac
Copy link

@mmastrac mmastrac commented Oct 2, 2025

Description

TIOCGETA/TIOCSETA are missing in Apple's libc implementation in this crate, but are present in the various OS headers. These ioctls are present in other BSD-like platforms and have the same functionality.

This PR adds:

  • TIOCGETA (0x40487413) for getting termios state
  • TIOCSETA (0x80487414) for setting termios state immediately
  • TIOCSETAW (0x80487415) for draining output then setting
  • TIOCSETAF (0x80487416) for draining output, flushing input, then setting

Fixes issue #4735.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

- Add TIOCGETA (0x40487413) for getting termios state
- Add TIOCSETA (0x80487414) for setting termios state immediately
- Add TIOCSETAW (0x80487415) for draining output then setting
- Add TIOCSETAF (0x80487416) for draining output, flushing input, then setting

These constants are present in macOS system headers but were missing
from the libc crate. Fixes issue rust-lang#4735.
@rustbot rustbot added O-macos O-unix stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Oct 2, 2025
@mmastrac mmastrac marked this pull request as ready for review October 2, 2025 21:04
@mmastrac mmastrac changed the title Add missing TIOCGETA/TIOCSETA constants for macOS apple: Add missing TIOCGETA/TIOCSETA constants Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-macos O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants