feat(libkernel_sys): implement __sys_nanosleep export #13256
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13256"
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 iAbdulrrahman on 2026-10-30T08:22:57Z.
What
Implement
__sys_nanosleep(msfSXXy-8H8) inlibkernel_sysby forwarding tolibkernel'snanosleep_nid_postfixas defined in FreeBSD 11.4 libclib/libc/sys/nanosleep.c. Add unit tests inGuestKernelSysNanosleep.cpptesting invalid requests, negative and zero seconds, and valid sleep requests.Tested
Windows 11,
ctest --test-dir build -R guest_kernel_sys_nanosleep --repeat until-fail:3 -V(passed 3/3 iterations).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:50:15Z.
Review: COMMENTED
On the code: the wrapper calls
scePthreadSetcancelstate(1, ...)aroundsceKernelNanosleep, i.e. it makes the raw syscall non-cancellable by hand and restores the state afterwards. IfsceKernelNanosleepthrows or longjmps out (guest signal jump), the cancel state is left disabled for the thread. Is the restore protected, and does the test cover an interrupted sleep with a non-nullrmtp?