Skip to content

refactor(libkernel): drop more errno saves around guest copies - #26202

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
LeandroLP23:refactor/kernel-guest-copy-errno
Nov 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
LeandroLP23:refactor/kernel-guest-copy-errno

Conversation

@LeandroLP23

Copy link
Copy Markdown
Contributor

What

Follow-up to #26010, for the rest of libkernel that no open pull request touches. GuestCopyIn_nid_no_patch, GuestCopyOut_nid_no_patch and GuestWritable_nid_no_patch restore errno themselves since #21243 (RestoreErrno in libc/src/General.cpp), so saving and restoring errno around them does nothing.

5 inline saves around a guest copy are removed, in DirectMemory/MemoryPoolExport.cpp, Pthread/src/Tsd.cpp and System/src/SoftwareVersion.cpp. A save is kept where the saved value is used again later in the function. 10 lines removed.

Four files with such saves are left out because open pull requests touch them:

No change in behaviour.

Tested

Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release. ctest -R 'kernel', with its 116 build outputs from tools/select_tests.py targets: 147 of 147 on main b16988fb8b and 147 of 147 with this change applied to it. tools/check_conventions.py passes. tools/pr_overlap.py --branch finds no overlap with the 2554 open pull requests.

Not run: Linux and macOS.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneandonlydean
oneandonlydean merged commit 0e9f973 into boykopovar:main Nov 23, 2026
14 checks passed
@LeandroLP23
LeandroLP23 deleted the refactor/kernel-guest-copy-errno branch November 23, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants