From 9217d969c88a225d62b629264271e31453699e63 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 2 Oct 2025 14:44:35 -0600 Subject: [PATCH 1/2] Add missing TIOCGETA/TIOCSETA constants for macOS - 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. --- src/unix/bsd/apple/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 6a78b3ffb6e4..95201bfbf929 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3150,6 +3150,10 @@ pub const TIOCDSIMICROCODE: c_uint = 0x20007455; pub const TIOCPTYGRANT: c_uint = 0x20007454; pub const TIOCPTYGNAME: c_uint = 0x40807453; pub const TIOCPTYUNLK: c_uint = 0x20007452; +pub const TIOCGETA: c_ulong = 0x40487413; +pub const TIOCSETA: c_ulong = 0x80487414; +pub const TIOCSETAW: c_ulong = 0x80487415; +pub const TIOCSETAF: c_ulong = 0x80487416; pub const BIOCGRSIG: c_ulong = 0x40044272; pub const BIOCSRSIG: c_ulong = 0x80044273; From 5133d6cb644e0b95903063c0475dfbeed1fab246 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 2 Oct 2025 15:03:07 -0600 Subject: [PATCH 2/2] Update semver tests --- libc-test/semver/apple.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index f31c071814b6..e9de533bc15d 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1448,6 +1448,7 @@ TIOCEXCL TIOCEXT TIOCFLUSH TIOCGDRAINWAIT +TIOCGETA TIOCGETD TIOCGPGRP TIOCIXOFF @@ -1492,6 +1493,9 @@ TIOCSCONS TIOCSCTTY TIOCSDRAINWAIT TIOCSDTR +TIOCSETA +TIOCSETAF +TIOCSETAW TIOCSETD TIOCSIG TIOCSPGRP