feat(libSceLibcInternal): implement posix_spawn actions #3651

Merged
MarcZX10 merged 2 commits from upstream-pr/3651 into main 2026-10-13 11:37:45 +00:00
MarcZX10 commented 2026-10-11 14:48:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T14:48:41Z.


What

Carries David's posix_spawn implementation from issue #3624, preserving his authorship. This PR covers process creation and spawn-configuration functions. The attribute and file-action calls follow FreeBSD 11.4: initialize/destroy the opaque objects, store attributes and ordered open/dup2/close actions, copy addopen paths, and return EBADF for negative descriptors. posix_spawn and posix_spawnp throw because process creation is not implemented; callers do not receive a guessed process ID.

Current title evidence

On main 88107b7de, Windows 11 catalog runs of both Dusklight (PPSA99305) and Wind Waker (PPSA99309) stop at unresolved import 44hlATrd47U (posix_spawnattr_init). This addresses their first reported import stop; it does not claim either title reaches gameplay with process creation still unsupported.

Tested

  • Before the current-main rebase, Linux GCC 12.2 Release built guest_posix_spawn_tests; CTest passed 1/1.
  • Prior Windows test coverage is reported in #3624, not on this current-main head.
  • The rebase onto 42e5edadb has not been built or tested locally. The Windows title reporter offered to rerun both titles on a rebased head; validation is pending.

Checklist

  • Rebased onto current main 42e5edadb; no other open PR implements these functions
  • One topic: POSIX spawn configuration and its explicit unsupported process-creation boundary
  • No comments in code except technical debt
  • No notes or investigation files added
  • Generic behavior, not title-specific
  • Depends on: none
  • Addresses the first reported import stop for PPSA99305 (#3624) and PPSA99309
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4819903568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T14:48:41Z. --- ### What Carries David's `posix_spawn` implementation from issue #3624, preserving his authorship. This PR covers process creation and spawn-configuration functions. The attribute and file-action calls follow FreeBSD 11.4: initialize/destroy the opaque objects, store attributes and ordered open/dup2/close actions, copy `addopen` paths, and return `EBADF` for negative descriptors. `posix_spawn` and `posix_spawnp` throw because process creation is not implemented; callers do not receive a guessed process ID. ### Current title evidence On `main` `88107b7de`, Windows 11 catalog runs of both Dusklight (PPSA99305) and Wind Waker (PPSA99309) stop at unresolved import `44hlATrd47U` (`posix_spawnattr_init`). This addresses their first reported import stop; it does not claim either title reaches gameplay with process creation still unsupported. ### Tested - Before the current-main rebase, Linux GCC 12.2 Release built `guest_posix_spawn_tests`; CTest passed 1/1. - Prior Windows test coverage is reported in #3624, not on this current-main head. - The rebase onto `42e5edadb` has not been built or tested locally. The Windows title reporter offered to rerun both titles on a rebased head; validation is pending. ### Checklist - [x] Rebased onto current `main` `42e5edadb`; no other open PR implements these functions - [x] One topic: POSIX spawn configuration and its explicit unsupported process-creation boundary - [x] No comments in code except technical debt - [x] No notes or investigation files added - [x] Generic behavior, not title-specific - [x] Depends on: none - [x] Addresses the first reported import stop for PPSA99305 (#3624) and PPSA99309 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 14:49:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:49:04Z.


Progress report (42e5eda → 7bb59f7)

📉 System libraries: 87.87% (-0.02%, +9 implemented, +2 declared functions)

✅ 9 implemented
Library Name
libSceLibcInternal posix_spawn_file_actions_addclose_nid_postfix
libSceLibcInternal posix_spawn_file_actions_adddup2_nid_postfix
libSceLibcInternal posix_spawn_file_actions_addopen_nid_postfix
libSceLibcInternal posix_spawn_file_actions_destroy_nid_postfix
libSceLibcInternal posix_spawn_file_actions_init_nid_postfix
libSceLibcInternal posix_spawnattr_destroy_nid_postfix
libSceLibcInternal posix_spawnattr_init_nid_postfix
libSceLibcInternal posix_spawnattr_setflags_nid_postfix
libSceLibcInternal posix_spawnattr_setsigdefault_nid_postfix
🆕 2 declared as stubs
Library Name
libSceLibcInternal posix_spawn_nid_postfix
libSceLibcInternal posix_spawnp_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110238757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6110238757). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T14:49:04Z. --- <!-- progress-report --> ### Progress report (42e5eda → 7bb59f7) 📉 **System libraries**: 87.87% (-0.02%, +9 implemented, +2 declared functions) <details> <summary>✅ 9 implemented</summary> | Library | Name | | - | - | | libSceLibcInternal | `posix_spawn_file_actions_addclose_nid_postfix` | | libSceLibcInternal | `posix_spawn_file_actions_adddup2_nid_postfix` | | libSceLibcInternal | `posix_spawn_file_actions_addopen_nid_postfix` | | libSceLibcInternal | `posix_spawn_file_actions_destroy_nid_postfix` | | libSceLibcInternal | `posix_spawn_file_actions_init_nid_postfix` | | libSceLibcInternal | `posix_spawnattr_destroy_nid_postfix` | | libSceLibcInternal | `posix_spawnattr_init_nid_postfix` | | libSceLibcInternal | `posix_spawnattr_setflags_nid_postfix` | | libSceLibcInternal | `posix_spawnattr_setsigdefault_nid_postfix` | </details> <details> <summary>🆕 2 declared as stubs</summary> | Library | Name | | - | - | | libSceLibcInternal | `posix_spawn_nid_postfix` | | libSceLibcInternal | `posix_spawnp_nid_postfix` | </details>
blawesom commented 2026-10-11 15:19:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:19:42Z.


Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Builds; tools/check_conventions.py --base origin/main passes.
  • Full suite: 833/833 passed (all tests including the Vulkan suites on AMD RX 9070 XT / RADV).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110517000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6110517000). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T15:19:42Z. --- Independent pre-review on **Linux** (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Builds; `tools/check_conventions.py --base origin/main` passes. - Full suite: **833/833 passed** (all tests including the Vulkan suites on AMD RX 9070 XT / RADV).
oneandonlydean commented 2026-10-11 23:58:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:58:32Z.


Closing: no title run reaches posix_spawn or the attribute and file-action calls on main; the evidence is the import list, and posix_spawn itself still throws. Reopen with the title ID and the log line where a run stops at one of them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115347966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6115347966). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:58:32Z. --- Closing: no title run reaches `posix_spawn` or the attribute and file-action calls on main; the evidence is the import list, and `posix_spawn` itself still throws. Reopen with the title ID and the log line where a run stops at one of them.
oneandonlydean commented 2026-10-12 02:47:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T02:47:46Z.


Reopened: #3640 has a title stopping on it now (PPSA99305, #3624), and this is its next stop after that. The close was premature.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116840449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6116840449). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T02:47:46Z. --- Reopened: #3640 has a title stopping on it now (PPSA99305, #3624), and this is its next stop after that. The close was premature.
oneandonlydean commented 2026-10-12 08:23:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:23:49Z.


Conflicts with main in docs/dev/TechnicalDebt.md, so the full build can't start; please rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120514594 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6120514594). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T08:23:49Z. --- Conflicts with main in `docs/dev/TechnicalDebt.md`, so the full build can't start; please rebase.
overlordxrz-source commented 2026-10-12 11:22:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by overlordxrz-source on 2026-10-12T11:22:15Z.


Run evidence for this one: on our Linux rig (lavapipe, main b42ef24e), Dusklight (PPSA99305) stops on the unresolved import posix_spawnattr_init (44hlATrd47U):
./app.elf: symbol lookup error: ./app.elf: undefined symbol: 44hlATrd47U
I can rerun it with this PR applied if that helps.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123257894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6123257894). Originally posted by [overlordxrz-source](https://github.com/overlordxrz-source) on 2026-10-12T11:22:15Z. --- Run evidence for this one: on our Linux rig (lavapipe, main b42ef24e), Dusklight (PPSA99305) stops on the unresolved import posix_spawnattr_init (44hlATrd47U): ./app.elf: symbol lookup error: ./app.elf: undefined symbol: 44hlATrd47U I can rerun it with this PR applied if that helps.
reyani-dev commented 2026-10-12 12:15:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-12T12:15:23Z.


A title whose first stop on main is this family: Dusklight (PPSA99305, v0.2.0, griches/PS5_Dusklight, GPL-3.0), which was added to the homebrew catalog this week. On main 9fca13b5 (Windows 11, catalog build with eboot.bin and sce_module/libc.prx unwrapped) it fails to load with

FAIL: unresolved ELF import 44hlATrd47U from libSceLibcInternal.prx

44hlATrd47U is posix_spawnattr_init. It's the title's first stop, with no other PR needed before it, unlike XPSemu, which needs several merges before it gets here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6124070578 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6124070578). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-12T12:15:23Z. --- A title whose first stop on `main` is this family: Dusklight (PPSA99305, v0.2.0, [griches/PS5_Dusklight](https://github.com/griches/PS5_Dusklight), GPL-3.0), which was added to the homebrew catalog this week. On `main` 9fca13b5 (Windows 11, catalog build with `eboot.bin` and `sce_module/libc.prx` unwrapped) it fails to load with ``` FAIL: unresolved ELF import 44hlATrd47U from libSceLibcInternal.prx ``` `44hlATrd47U` is `posix_spawnattr_init`. It's the title's first stop, with no other PR needed before it, unlike XPSemu, which needs several merges before it gets here.
LeandroLP23 commented 2026-10-13 07:06:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T07:06:30Z.


A second catalog title now stops on this family: Wind Waker (PPSA99309, catalog 1.0.1, GPL-3.0), new this week. On main 88107b7de, Windows 11, relinked with --windows --trap-sdk-syscall-stubs, it exits after 4 s with FAIL: unresolved ELF import 44hlATrd47U from libSceLibcInternal.prx (posix_spawnattr_init), the same first stop as Dusklight (PPSA99305). The PR conflicts with main now; once it's rebased I can run both titles with it on Windows.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140238756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6140238756). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T07:06:30Z. --- A second catalog title now stops on this family: Wind Waker (PPSA99309, catalog 1.0.1, GPL-3.0), new this week. On `main` `88107b7de`, Windows 11, relinked with `--windows --trap-sdk-syscall-stubs`, it exits after 4 s with `FAIL: unresolved ELF import 44hlATrd47U from libSceLibcInternal.prx` (`posix_spawnattr_init`), the same first stop as Dusklight (PPSA99305). The PR conflicts with `main` now; once it's rebased I can run both titles with it on Windows. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-13 07:12:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:12:01Z.


Thanks for the additional title report. Wind Waker (PPSA99309) independently confirms the same posix_spawnattr_init load stop as Dusklight, and a Windows run of the PR would be useful. The PR currently conflicts with main, so please hold the comparison until there is a rebased head; I will post again when that is ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140317875 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6140317875). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:12:01Z. --- Thanks for the additional title report. Wind Waker (PPSA99309) independently confirms the same posix_spawnattr_init load stop as Dusklight, and a Windows run of the PR would be useful. The PR currently conflicts with main, so please hold the comparison until there is a rebased head; I will post again when that is ready.
MarcZX10 commented 2026-10-13 07:41:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:41:12Z.


Rebased onto current main and preserved the current libSceLibcInternal CMake entries and debt documentation. The new debt entry records the updated evidence: both Dusklight (PPSA99305) and Wind Waker (PPSA99309) stop on main 88107b7de at unresolved import 44hlATrd47U (posix_spawnattr_init). The previous Linux and Windows results predate this rebase; I have not rerun the current head locally.

@LeandroLP23, you offered to rerun both titles once the PR was rebased. Could you check this exact head and report the first stop after it, if convenient? posix_spawn/posix_spawnp still throw, so this PR does not claim the titles reach gameplay.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140758535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6140758535). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:41:12Z. --- Rebased onto current `main` and preserved the current `libSceLibcInternal` CMake entries and debt documentation. The new debt entry records the updated evidence: both Dusklight (PPSA99305) and Wind Waker (PPSA99309) stop on `main` `88107b7de` at unresolved import `44hlATrd47U` (`posix_spawnattr_init`). The previous Linux and Windows results predate this rebase; I have not rerun the current head locally. @LeandroLP23, you offered to rerun both titles once the PR was rebased. Could you check this exact head and report the first stop after it, if convenient? `posix_spawn`/`posix_spawnp` still throw, so this PR does not claim the titles reach gameplay.
MarcZX10 commented 2026-10-13 07:56:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:56:41Z.


The branch is now rebased onto current main (42e5edadb), with David’s implementation commit preserved. The two reported catalog stops are still the stated basis; I have not rerun either title locally. @LeandroLP23, could you rerun Dusklight and Wind Waker on this exact head and report the next stop (or successful load), when convenient? posix_spawn and posix_spawnp remain explicitly unsupported, so the expected result may simply be a later stop.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141006812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6141006812). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:56:41Z. --- The branch is now rebased onto current `main` (`42e5edadb`), with David’s implementation commit preserved. The two reported catalog stops are still the stated basis; I have not rerun either title locally. @LeandroLP23, could you rerun Dusklight and Wind Waker on this exact head and report the next stop (or successful load), when convenient? `posix_spawn` and `posix_spawnp` remain explicitly unsupported, so the expected result may simply be a later stop.
LeandroLP23 commented 2026-10-13 09:00:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T09:00:47Z.


Ran both titles on this exact head, 7bb59f73b, merged onto main 4bb2c7f39. The base needs #5014: on 42e5edadb alone, no title loads on Windows, because libSceAgcDriver.prx imports LibcUnwind::CursorSlots from libc.prx. Setup: Windows 11 (26300), WinLibs GCC 15.2.0, Release, relinked with --windows --trap-sdk-syscall-stubs.

  • ctest -R posix_spawn: 3/3.
  • Dusklight (PPSA99305): gets past posix_spawnattr_init and stops next at FAIL: unresolved ELF import cPGyc5FGjy0 from libSceLibcInternal.prx (atanhf), after 3 s.
  • Wind Waker (PPSA99309): the same, now stopping at atanhf.
  • DOOM on the same build runs 60 s, as on main.

So this PR moves both titles one import further. The next stop for both is atanhf.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6142057497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6142057497). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T09:00:47Z. --- Ran both titles on this exact head, `7bb59f73b`, merged onto `main` `4bb2c7f39`. The base needs #5014: on `42e5edadb` alone, no title loads on Windows, because `libSceAgcDriver.prx` imports `LibcUnwind::CursorSlots` from `libc.prx`. Setup: Windows 11 (26300), WinLibs GCC 15.2.0, Release, relinked with `--windows --trap-sdk-syscall-stubs`. - `ctest -R posix_spawn`: 3/3. - **Dusklight (PPSA99305):** gets past `posix_spawnattr_init` and stops next at `FAIL: unresolved ELF import cPGyc5FGjy0 from libSceLibcInternal.prx` (`atanhf`), after 3 s. - **Wind Waker (PPSA99309):** the same, now stopping at `atanhf`. - DOOM on the same build runs 60 s, as on `main`. So this PR moves both titles one import further. The next stop for both is `atanhf`. AI-assisted: yes (Claude Code)
LeandroLP23 commented 2026-10-13 14:09:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T14:09:11Z.


Dusklight (PPSA99305) reaches Menus on main now that this PR and #5036 are merged: Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0, Release, main 6cd052848 with no patches, catalog release relinked with --windows --trap-sdk-syscall-stubs, 60 s with APS5_PAD_INPUT_FILE pulses from 30 s, frames dumped with APS5_DUMP_FRAMES. It draws its title menu (Select disc image, Settings, Mods, Quit; "No disc image found."), and it responds to the controller: D-pad down moves the selection from Select disc image to Settings, then to Quit. No disc image was used.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6147458953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3651#issuecomment-6147458953). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T14:09:11Z. --- Dusklight (PPSA99305) reaches **Menus** on `main` now that this PR and #5036 are merged: Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0, Release, `main` `6cd052848` with no patches, catalog release relinked with `--windows --trap-sdk-syscall-stubs`, 60 s with `APS5_PAD_INPUT_FILE` pulses from 30 s, frames dumped with `APS5_DUMP_FRAMES`. It draws its title menu (Select disc image, Settings, Mods, Quit; "No disc image found."), and it responds to the controller: D-pad down moves the selection from Select disc image to Settings, then to Quit. No disc image was used.
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!3651
No description provided.