Adds tcsendbreak (vXE-dIUIZlE), tcdrain (brGGJWsZauw), tcflush
(FxHW5NuEXsY), tcflow (OG8xRaGIpqk), tcgetpgrp (5OEl1mRhUm0) and
tcsetpgrp (YMuesZTyTl4) next to tcgetattr and tcsetattr in
File/src/Terminal.cpp. The NIDs come from tools/nid_names.py and match
aerolib.csv (zecoxao/sce_symbols 2883963a).
They follow FreeBSD 11.4 lib/libc/gen/termios.c (8c639945), which
implements each one over a terminal ioctl: tcflush returns EINVAL for a
queue other than TCIFLUSH, TCOFLUSH or TCIOFLUSH and tcflow for an
action outside TCOOFF..TCION before the descriptor is used; every other
call fails with the error the merged tcgetattr gives (EBADF for a closed
descriptor, ENOTTY for a file or pipe, EADDRNOTAVAIL or EOPNOTSUPP for a
socket, per soo_ioctl and in_control/in6_control). tcsendbreak fails on
TIOCSBRK before its 0.4 s pause, and tcflow's TCIOFF/TCION fail in
tcgetattr. FreeBSD's pipe_ioctl answers TIOCGPGRP/TIOCSPGRP on a pipe or
FIFO with the SIGIO owner, which is not modelled, so tcgetpgrp and
tcsetpgrp throw on a host pipe above descriptor 2.
Titles (homebrew catalog boykopovar#1578), predicted stops from registry order:
- PS5MC PPSA99420 imports tcsendbreak (442), tcdrain (443), tcflush
(444), tcflow (445), tcgetpgrp (462) and tcsetpgrp (463); once pause
and setrlimit are in, it stops at
"FAIL: unresolved ELF import vXE-dIUIZlE from libkernel.prx".
- XPSemu PPSA97358 imports tcsendbreak (214), its first uncovered import
after execv, sigwait, setrlimit, mlockall, setuid and getopt:
"FAIL: unresolved ELF import vXE-dIUIZlE from libkernel.prx".
guest_terminal covers each call over stdin, stdout, stderr, a file, both
pipe ends and an AF_INET socket, the EINVAL cases (also on -1), and
EBADF for -1, a closed socket, a closed pipe and a closed file.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What
Carries screamm's
screamm/AnyPS5:feat/libkernel-termios-callscommit from #3723 unchanged onto currentmain, preserving its author, and adds one follow-up test commit:tcsendbreak,tcdrain,tcflush,tcflow,tcgetpgrpandtcsetpgrpnext to the mergedtcgetattr/tcsetattr, after FreeBSD 11.4lib/libc/gen/termios.c.tcflushandtcflowreturnEINVALfor an out-of-range queue or action before the descriptor is used; every other case fails with the errortcgetattrgives (EBADF,ENOTTYfor a file or pipe,EADDRNOTAVAILforAF_INET,EOPNOTSUPPfor other sockets).tcgetpgrp/tcsetpgrpthrow on a host pipe above descriptor 2, because FreeBSD answers there with the SIGIO owner, which is not modelled. PS5MC (PPSA99420) and XPSemu (PPSA97358) import all six, as reported in libkernel: tcsendbreak, tcdrain, tcflush, tcflow, tcgetpgrp and tcsetpgrp are absent (PS5MC, XPSemu); fix branch ready #3723.guest_terminalwith a Unix-domain socket pair and a directory descriptor. The original test never reached theEOPNOTSUPPbranch or a descriptor that is neither a file nor a pipe: withTerminalErrorreturningEADDRNOTAVAILfor every socket family, orHostPipetreating any non-regular file as a pipe, the original test still passes and the extended one fails.The library progress moves from 2903/3383 (85.81%) to 2909/3389 (85.84%). The total rises by six because none of the six calls was exported before.
Closes #3723.
Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), based onmaina11c8f7f:libs, and fullctest: 824 pass, 8 skip, no failures (832 registered tests).guest_terminalpasses 10 consecutive runs. This is the first Linux run of the carried commit; the author reported Windows only.Terminal.cppone at a time and checked against both the original and the extended test.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository