Merge pull request #1650 from Pedroj-64/feat/libkernel-uid-gid

feat(libkernel): implement getuid, geteuid, getgid, getegid and issetugid
This commit is contained in:
Adrià 2026-10-09 23:04:27 +02:00 committed by GitHub
commit 27cb335be1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -141,6 +141,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);
}

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
- [sceNpEntitlementAccess{Request,Poll}{Unified,Service}EntitlementInfoList](../../core/libs/prx/libSceNpEntitlementAccess/Export.cpp) - signatures unknown; no reference implements them, so they are declared without parameters. Like the consume requests in the same library, they report the signed-out NP state with `SCE_NP_ERROR_SIGNED_OUT` (`0x80550006`) and write nothing. PPSA15657 calls the unified request during start-up and continues past the error. Whether the console fails at the request or at the poll when signed out is 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