feat(libkernel): implement sceKernelFcntl #3078

Merged
MarcZX10 merged 1 commit from upstream-pr/3078 into main 2026-10-10 22:15:30 +00:00
MarcZX10 commented 2026-10-10 21:50:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T21:50:55Z.


What

Carry screamm's explicitly offered sceKernelFcntl implementation from issue #3048. It delegates supported socket F_GETFL/F_SETFL operations to the existing fcntl export, translates guest errors to SCE_KERNEL_ERROR_*, and throws for regular-file descriptors whose flags are not tracked. The source commit author is preserved.

Tested

The contributor reports Windows 11 Pro 26220 / WinLibs GCC 15.2.0 / Release full build including libs; guest_kernel_fcntl passed 3/3 and ctest -j8 -E "^agc_|video_out" passed 389/389. The reporter did not report Linux runtime tests. After rebasing onto current main, this session configured a Linux Release build, built libkernel and guest_kernel_fcntl_tests, and ran guest_kernel_fcntl 5 times successfully; conventions and git diff --check passed.

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4814682691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3078). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T21:50:55Z. --- ### What Carry screamm's explicitly offered `sceKernelFcntl` implementation from issue #3048. It delegates supported socket `F_GETFL`/`F_SETFL` operations to the existing `fcntl` export, translates guest errors to `SCE_KERNEL_ERROR_*`, and throws for regular-file descriptors whose flags are not tracked. The source commit author is preserved. ### Tested The contributor reports Windows 11 Pro 26220 / WinLibs GCC 15.2.0 / Release full build including `libs`; `guest_kernel_fcntl` passed 3/3 and `ctest -j8 -E "^agc_|video_out"` passed 389/389. The reporter did not report Linux runtime tests. After rebasing onto current `main`, this session configured a Linux Release build, built `libkernel` and `guest_kernel_fcntl_tests`, and ran `guest_kernel_fcntl` 5 times successfully; conventions and `git diff --check` passed. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 21:51:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T21:51:15Z.


Progress report (2b83151 → 9902f13)

📈 System libraries: 84.9% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel sceKernelFcntl
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102552721 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3078#issuecomment-6102552721). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T21:51:15Z. --- <!-- progress-report --> ### Progress report (2b83151 → 9902f13) 📈 **System libraries**: 84.9% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `sceKernelFcntl` | </details>
adriadam10 commented 2026-10-10 22:11:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:11:40Z.


Checked on Linux: guest_kernel_fcntl passes and fails without the change (negative check), plus the neighbouring guest_dup, guest_fstatfs and guest_kill; the nid-alias check is clean. The only conflict with main was the TechnicalDebt.md line adjacency, so I rebased and moved the line off the end of the section. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102722478 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3078#issuecomment-6102722478). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T22:11:40Z. --- Checked on Linux: `guest_kernel_fcntl` passes and fails without the change (negative check), plus the neighbouring `guest_dup`, `guest_fstatfs` and `guest_kill`; the nid-alias check is clean. The only conflict with main was the `TechnicalDebt.md` line adjacency, so I rebased and moved the line off the end of the section. Merging once CI is green.
github-actions[bot] commented 2026-10-10 22:16:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T22:16:46Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#3047 docs/dev/TechnicalDebt.md L489
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102762870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3078#issuecomment-6102762870). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T22:16:46Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3047 | `docs/dev/TechnicalDebt.md` [L489](https://github.com/boykopovar/AnyPS5/blob/a883f22f1ce4016b881d2e791470137c879f193e/docs/dev/TechnicalDebt.md#L489) | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3078
No description provided.