feat(libc): implement memccpy #2217
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2217"
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 obojeoboje on 2026-10-09T11:53:47Z.
What
Implement
memccpyin guest libc. Copy through the first byte matching the unsigned-char conversion of the stop value, return the address immediately after that byte, and return null when the count is exhausted. Leave the rest of the destination untouched.Semantics checked against FreeBSD libc memccpy. The implementation is written locally without importing third-party source.
Extend
guest_stringswith cases for the first matching byte, repeated matches, embedded zero bytes, no match, a match at the count boundary, a match outside the count, zero count, unsigned-char conversion, and destination canaries.This adds a previously undeclared export: the progress scanner changes from 2578/3044 (84.69%) to 2579/3045 (84.70%).
Tested
Windows, WinLibs GCC 15.2.0, Release, full-project CMake configuration:
cmake --build build --target guest_string_tests nid_patcher --parallel 4succeeded, rebuilding libc and its relevant dependent libraries.ctest --test-dir build --output-on-failure -R '^guest_strings$'passed (0.02 s).git diff --checkandpython tools/check_conventions.py --base origin/mainpassed.No game or homebrew tested. The full all-target build and complete test suite were not run.
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 MarcZX10 on 2026-10-09T12:09:57Z.
I reviewed the complete diff. The byte-by-byte copy, unsigned-char stop conversion, return pointer, and no-match behavior look correct; the regression cases cover the main boundary and canary cases. The PR reports a successful Windows focused build/test, and Conventions passes on head
4ede8898. CONTRIBUTING says libc changes need the full Linux and Windows Build plus the relinker matrix; those checks are not currently present on this PR. Could a collaborator run Actions → Build for #2217 so the exact head gets the required project checks? I am holding formal approval until those results are available.Imported from boykopovar/AnyPS5. Originally posted by obojeoboje on 2026-10-09T12:14:23Z.
@MarcZX100 Thanks for the review! Could a collaborator with write access run Actions → Build for PR #2217 at head
4ede8898, including the Linux/Windows builds and relinker matrix? I’ll address any failures reported by those checks.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:10:14Z.
Closing: no title is shown reaching
memccpyon main (#1976 was closed for the same reason). Reopen with the title ID and the log line when one stops at it.Pull request closed