feat(libkernel): implement getuid, geteuid, getgid, getegid and issetugid

Part of #1578.
This commit is contained in:
Pedro
2026-10-08 10:39:06 -05:00
parent 4b005b229e
commit a294b80d29
2 changed files with 21 additions and 0 deletions
@@ -138,6 +138,26 @@ int APS5_VABI getpid_nid_postfix(void) {
return static_cast<int>(pid);
}
int APS5_VABI getuid_nid_postfix(void) {
return 0;
}
int APS5_VABI geteuid_nid_postfix(void) {
return 0;
}
int APS5_VABI getgid_nid_postfix(void) {
return 0;
}
int APS5_VABI getegid_nid_postfix(void) {
return 0;
}
int APS5_VABI issetugid_nid_postfix(void) {
return 0;
}
void APS5_VABI exit_nid_postfix(int code) {
LibcExit_nid_no_patch(code);
}
+1
View File
@@ -38,6 +38,7 @@ Throughout the project, every function at every stage either **does exactly what
### Unknown function info
- [getuid, geteuid, getgid, getegid and issetugid](../../core/libs/prx/libkernel/System/src/Process.cpp) (libkernel) report the root identity (0) and a process that never changed credentials (`issetugid` 0), as a jailbroken process has; the host user and group are not exposed to the guest. The values a title sees on a console are unverified
- [sceNpEntitlementAccessGetEntitlementKey](../../core/libs/prx/libSceNpEntitlementAccess/Export.cpp) - the three-argument signature, 16-byte key and errors `0x817D0002`/`0x817D0007` follow [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/main/src/libs/libNet.cpp); PPSA01521 passes a service label, entitlement label and output pointer. Only the no-key path is implemented: local entitlement labels carry no keys, and the output is untouched on failure. Console error precedence and key provisioning are unverified
- [sceRudpGetStatus](../../core/libs/prx/libSceRudp/Export.cpp) - PPSA01521 passes an output pointer and byte count `0xF8`; the status layout, size rules and error behavior are unknown. The export throws without writing output, including after initialization. [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/rudp/rudp.cpp) declares it without arguments and returns success without writing status
- [sceHttpSetCookieEnabled](../../core/libs/prx/libSceHttp/Export.cpp) - the two-argument signature and 0/1 enable values follow [VitaSDK](https://github.com/vitasdk/vita-headers/blob/master/include/psp2/net/http.h) and [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/network/http.cpp); PPSA01521 passes 0 to disable cookies. Disabling succeeds because the offline HTTP backend has no cookie engine; enabling throws. Invalid enable values use the same error as `sceHttpSetInflateGZIPEnabled`. Like the existing offline HTTP setters, the handle is not validated; requests still fail with the network error. Console behavior is unverified