feat(libkernel): implement sceKernelFcntl #1108
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1108"
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 nicolasabosch on 2026-10-07T12:33:43Z.
What
sceKernelFcntlwas a throwing stub; PPSA14632 (LEGO Horizon Adventures) imports it. This implements it with the(fd, cmd, arg)signature, command numbers and flag masks of FreeBSD 11fcntl.handkern_fcntlinkern_descrip.c.sceKernelOpenandopen:F_GETFD,F_SETFD,F_GETFL,F_SETFL. The status flagsopenkeeps (FMASK) andO_CLOEXECare recorded beside the host descriptor at open and forgotten at close, since the Windows CRT cannot report them for a descriptor.F_SETFLreplaces theFCNTLFLAGSbits likekern_fcntland ignores the rest. OnlyO_NONBLOCKandO_DIRECTmay change, as they do nothing to a regular host file; a change ofO_APPEND,O_ASYNC,O_FSYNCor the read-ahead flag throws, because the open host file cannot follow it.fcntlpath (F_GETFL,F_SETFL) and its errno is returned as an SCE error.Which commands the title passes is not known: it imports the function, and I have no log of a call. POSIX
fcntlis unchanged and still handles sockets only;Socket/src/Udp.cppis left alone because #1088 and #1091 change it.Tested
Windows 11, WinLibs GCC 15.2.0: full build,
libstarget andctest(384 passed;agc_driver_sdwa_float_selectors,shader_clock,vop1_float_unary,vop3_mad_i64andvopc_compareexcluded, they fail on this machine's Intel Arc GPU without this change). Newguest_fcntltest covers files,O_CLOEXEC, POSIXopen/close, a directory, a pipe and a UDP socket. Not tested on Linux and not tested with a title.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-07T12:34:17Z.
Progress report (
62ffd1e→c6ebb64)📈 System libraries: 86.64% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceKernelFcntlImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T12:35:07Z.
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)core/libs/prx/libkernel/File/src/Open.cppL118__error_nid_postfixdocs/dev/TechnicalDebt.mdL101Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:25:44Z.
Does PPSA14632 call
sceKernelFcntlon main? Main already exports a throwing stub, so the import alone doesn't stop it. With the log line where it stops at this call (and the command it passes) this can go in; otherwise I'll close it until a title does.Pull request closed