feat(libkernel): export environ as an empty environment #2090
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2090"
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 LeandroLP23 on 2026-10-09T07:57:54Z.
What
PICO-8 for PS5 (PPSA99808 v0.1.2, RafaelNGP/pico8-ps5, GPL-3.0) stops at start-up on
environonce__inet_aton(#1848) resolves:+2thxYZ4sykisenviron. FreeBSD's libcgetenvreads it andsetenv/putenvreplace it, so the export is a writablechar**.It points to an empty, null-terminated array. A PS5 app starts with no environment variables: the payload SDK's
elfldr(elfldr_set_environin ps5-payload-dev/websrv) writesenvirononly when it has variables to pass, and shadPS4 exports the same NID as a pointer to an empty array (src/core/libraries/kernel/kernel.cpp).Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release,
mainf1451396:N2OjwJJGjeQfromlibSceLibcInternal.prx(freeifaddrs, #1772).guest_system_configurationchecks thatenvironis non-null and empty.tools/check_conventions.pypasses.Linux and Windows: fork CI https://github.com/LeandroLP23/AnyPS5/actions/runs/37899939325, all jobs pass.
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 Amirtheshwaran on 2026-10-10T04:40:18Z.
Tested on Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7, same as CI), Release:
main.guest_system_configurationbuilds and passes.libkernel.prxexports+2thxYZ4syk.One question: libc's
Environment.cppseeds the guest environment from the host, sogetenv("PATH")returns a value whileenvironstays empty, andsetenvchanges never show up in it. Is that intended for now? If so, it might be worth a line inTechnicalDebt.mdunder "Unknown function info", like__prognamehas.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-10T07:16:53Z.
Thanks for testing it. Yes, that's how it is for now:
environis a fixed empty environment so titles that import it can load. It isn't linked to libc's environment, so it doesn't show the variablesgetenvsees, andsetenv/putenvchanges don't appear in it. You're right that it belongs in TechnicalDebt next to__progname; I missed that in this PR. I'll add the line in a follow-up as soon as I can open PRs again (the intake check closes new ones from my account for now); anyone who can open one is welcome to take it first.