Repository navigation
feat(libkernel): implement sceKernelFcntl - #1108
Closed
nicolasabosch wants to merge 1 commit into
Closed
nicolasabosch wants to merge 1 commit into
nicolasabosch wants to merge 1 commit into
Conversation
PPSA14632 imports sceKernelFcntl, which was a throwing stub. The signature, command numbers and flag masks follow FreeBSD 11 fcntl.h and kern_fcntl. F_GETFD, F_SETFD, F_GETFL and F_SETFL work on descriptors opened through sceKernelOpen and open: the status and descriptor flags are recorded at open and forgotten at close. F_SETFL changes O_NONBLOCK and O_DIRECT only; a change that the open host file cannot follow throws. Socket descriptors take the existing fcntl path and return its errno as an SCE error. Other descriptors and commands throw.
9 tasks done
|
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.
|
9 tasks done
Collaborator
|
Does PPSA14632 call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)