libc: isnanf, __signbitl and the posix_spawn family are absent (XPSemu); fix branch ready #3624

Closed
opened 2026-10-11 14:21:46 +00:00 by screamm · 3 comments
screamm commented 2026-10-11 14:21:46 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T14:21:46Z.


libc/libSceLibcInternal lacks isnanf, __signbitl and the posix_spawn family (posix_spawn, posix_spawnp, posix_spawnattr_init/destroy/setflags/setsigdefault, posix_spawn_file_actions_init/destroy/addclose/adddup2/addopen; 13 NIDs, all confirmed in aerolib). From the relink registry order they are predicted next stops of XPSemu (PPSA97358, indices 296, 363 and 347 to 381); not yet observed in a run.

Fix branch ready: screamm:feat/libc-xpsemu-spawn (two commits on main a11c8f7f: 4e8ede3e feat(libc): implement isnanf and __signbitl, efd9c2e0 feat(libSceLibcInternal): implement the posix_spawn attribute and file action calls). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are.

  • isnanf calls the existing __isnanf (FreeBSD isnan.c aliases them); __signbitl reads bit 7 of byte 9 of the 80-bit value as FreeBSD s_signbit.c, with a static_assert on the host long double. guest_math covers NaNs including signalling ones, infinities, signed zeros, extremes and subnormals.
  • New libSceLibcInternal/Spawn.cpp: the nine object calls follow FreeBSD 11.4 lib/libc/gen/posix_spawn.c (8c639945): zeroed attribute object, ENOMEM on allocation failure, EBADF for negative descriptors in the three add* calls, actions recorded in order, addopen copying the path, file_actions_init returning -1 on allocation failure as 11.4 does; null or uninitialised objects throw. posix_spawn/posix_spawnp throw process creation not implemented like execvp (#2827), since FreeBSD validates nothing before the child and no child can be created here; recorded in TechnicalDebt next to fork. New guest_posix_spawn covers the round trips, the recorded sequence, the EBADF cases and the throws.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: guest_posix_spawn, guest_math, guest_utime 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 534/537, the failures being the known windows_exceptions (#3411), guest_kernel_sys (#3510) and guest_filesystem (#3518); with main's Math.cpp the extended math test fails; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5801909710 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3624). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T14:21:46Z. --- libc/libSceLibcInternal lacks `isnanf`, `__signbitl` and the `posix_spawn` family (`posix_spawn`, `posix_spawnp`, `posix_spawnattr_init/destroy/setflags/setsigdefault`, `posix_spawn_file_actions_init/destroy/addclose/adddup2/addopen`; 13 NIDs, all confirmed in aerolib). From the relink registry order they are predicted next stops of XPSemu (PPSA97358, indices 296, 363 and 347 to 381); not yet observed in a run. **Fix branch ready:** [`screamm:feat/libc-xpsemu-spawn`](https://github.com/screamm/AnyPS5/tree/feat/libc-xpsemu-spawn) (two commits on `main` `a11c8f7f`: `4e8ede3e` `feat(libc): implement isnanf and __signbitl`, `efd9c2e0` `feat(libSceLibcInternal): implement the posix_spawn attribute and file action calls`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are. - `isnanf` calls the existing `__isnanf` (FreeBSD `isnan.c` aliases them); `__signbitl` reads bit 7 of byte 9 of the 80-bit value as FreeBSD `s_signbit.c`, with a `static_assert` on the host long double. `guest_math` covers NaNs including signalling ones, infinities, signed zeros, extremes and subnormals. - New `libSceLibcInternal/Spawn.cpp`: the nine object calls follow FreeBSD 11.4 `lib/libc/gen/posix_spawn.c` (`8c639945`): zeroed attribute object, `ENOMEM` on allocation failure, `EBADF` for negative descriptors in the three `add*` calls, actions recorded in order, `addopen` copying the path, `file_actions_init` returning -1 on allocation failure as 11.4 does; null or uninitialised objects throw. `posix_spawn`/`posix_spawnp` throw `process creation not implemented` like `execvp` (#2827), since FreeBSD validates nothing before the child and no child can be created here; recorded in TechnicalDebt next to `fork`. New `guest_posix_spawn` covers the round trips, the recorded sequence, the `EBADF` cases and the throws. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: `guest_posix_spawn`, `guest_math`, `guest_utime` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 534/537, the failures being the known `windows_exceptions` (#3411), `guest_kernel_sys` (#3510) and `guest_filesystem` (#3518); with `main`'s `Math.cpp` the extended math test fails; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
MarcZX10 commented 2026-10-11 14:48:46 +00:00 (Migrated from github.com)
Author
Contributor

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


I carried David’s posix_spawn commit into PR #3651, preserving its author metadata. I kept the spawn family in its own PR because it is a separate topic from isnanf and __signbitl, which are already in my #3640. The Linux/GCC 12.2 Release guest_posix_spawn test passed 1/1; conventions and git diff --check pass against current main. The PR links the FreeBSD 11.4 source and makes clear that XPSemu’s predicted startup stop has not been confirmed in a title run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110236074 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3624#issuecomment-6110236074). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T14:48:46Z. --- I carried David’s `posix_spawn` commit into [PR #3651](https://github.com/boykopovar/AnyPS5/pull/3651), preserving its author metadata. I kept the spawn family in its own PR because it is a separate topic from `isnanf` and `__signbitl`, which are already in my #3640. The Linux/GCC 12.2 Release `guest_posix_spawn` test passed 1/1; conventions and `git diff --check` pass against current `main`. The PR links the FreeBSD 11.4 source and makes clear that XPSemu’s predicted startup stop has not been confirmed in a title run.
LeandroLP23 commented 2026-10-13 13:23:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T13:23:41Z.


All 13 functions listed here are on main now: isnanf and __signbitl from #3640, and the posix_spawn family from #3651 (merged 2026-10-13). Every NID is in the export tables of the built libc.prx / libSceLibcInternal.prx. Build of main 0f2683cb7 (Windows, WinLibs GCC 15.2.0, Release), checked with objdump -p on the built modules. Neither PR used a closing keyword, so this stayed open. Could a maintainer close it?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6146558814 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3624#issuecomment-6146558814). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T13:23:41Z. --- All 13 functions listed here are on `main` now: `isnanf` and `__signbitl` from #3640, and the `posix_spawn` family from #3651 (merged 2026-10-13). Every NID is in the export tables of the built `libc.prx` / `libSceLibcInternal.prx`. Build of `main` `0f2683cb7` (Windows, WinLibs GCC 15.2.0, Release), checked with `objdump -p` on the built modules. Neither PR used a closing keyword, so this stayed open. Could a maintainer close it?
oneandonlydean commented 2026-10-14 00:09:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:09:16Z.


Closing: isnanf and __signbitl came in with #3640, the posix_spawn family with #3651. Comment here if XPSemu stops on any of them on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157877153 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3624#issuecomment-6157877153). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T00:09:16Z. --- Closing: `isnanf` and `__signbitl` came in with #3640, the posix_spawn family with #3651. Comment here if XPSemu stops on any of them on current main.
Sign in to join this conversation.
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#3624
No description provided.