Skip to content

Conversation

mmastrac
Copy link
Contributor

@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 #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
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JohnTitor JohnTitor added this pull request to the merge queue Oct 7, 2025
Merged via the queue into rust-lang:main with commit a7fe341 Oct 7, 2025
52 checks passed
JohnTitor pushed a commit to JohnTitor/libc that referenced this pull request Oct 9, 2025
(backport rust-lang#4736)

(cherry picked from commit a7fe341)
@JohnTitor JohnTitor mentioned this pull request Oct 9, 2025
JohnTitor pushed a commit to JohnTitor/libc that referenced this pull request Oct 9, 2025
- 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.

(backport <rust-lang#4736>)
(cherry picked from commit 755613e)
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2025
(backport #4736)

(cherry picked from commit a7fe341)
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2025
- 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 #4735.

(backport <#4736>)
(cherry picked from commit 755613e)
@JohnTitor JohnTitor added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-macos O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS TIOCGETA/TIOCSETA are missing

3 participants