feat(libkernel): export _ioctl #3487
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3487"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by DariusHQ on 2026-10-11T11:26:07Z.
What
_ioctl(wW+k21cmbwQ) in libkernel. FreeBSD's_ioctlis the same system call asioctl, so it forwards to the existingioctlexportStremio Plus (PPSA74126 0.5.6, LoZazaMastro/Stremio-Plus) stops at it at start-up on
main9a9bd3fb3, Windows, catalog build witheboot.binandsce_module/libc.prxunwrapped as #2605 requires (tracked in #1578):With this branch it goes on to
getsid(gokWod7GAH4), its last absent import:The title calls
_ioctlonly from its statically linked copy of FreeBSD'slib/libc/gen/termios.c:tcgetattr,tcsetattr,tcsetpgrp,tcgetpgrp,tcgetsid,tcsetsid,tcsendbreak,tcdrain,tcflushandtcflow. They sendTIOCGETA,TIOCSETA,TIOCSETAW,TIOCSETAF,TIOCSPGRP,TIOCGPGRP,TIOCGSID,TIOCSCTTY,TIOCSBRK,TIOCCBRK,TIOCDRAIN,TIOCFLUSH,TIOCSTOPandTIOCSTARTioctlhandlesFIONBIOandFIONREADon sockets only. Another request on a socket fails withENOTTY. Any request on a file or pipe descriptor fails withEBADF, where FreeBSD answersFIONBIOandFIONREADthere too and fails the termios requests withENOTTY. That limit is not new, but it was not recorded, so TechnicalDebt now lists it for both names.Tested
Windows 11 (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build with
BUILD_TESTING=ONon9a9bd3fb3:ctest830/832 passed. The two failures are known:windows_exceptionsfails the same way onmain(#3411)agc_driver_prepared_shaders_debugexited with a heap corruption (0xc0000374, as in #3171) and passed 5/5 when rerun aloneguest_udpnow also calls_ioctl:FIONREADon a socket returns 0 and writes the queued byte count, an unknown request fails withENOTTY, and a closed descriptor fails withEBADF. A mutant that forwards a fixed request instead of the caller's fails the test.tools/import_audit.pyon Stremio Plus relinked with--windows --registry: absent imports go from 2 to 1 (getsid).Not run on Linux (no Linux host here); the change is the same on both.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T11:26:38Z.
Progress report (
0f863c1→b4a59e3)📈 System libraries: 85.75% (+0.01%, +1 implemented functions)
✅ 1 implemented
_ioctl_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T11:44:25Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)_ioctl_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:54:39Z.
Checked the build and
guest_udpon Linux (libkernel scope): it passes, and without the change it fails to link (_ioctlmissing)._ioctlforwards to the existingioctl, matching FreeBSD where both are the same syscall, and the TechnicalDebt entry is in the right section. Merging once CI is green.Note: #3493 also exports
_ioctl; it will need to drop that part after this lands.