feat: add SYS_GETCAPS syscall to retrieve process capabilities

This commit is contained in:
daniel committed 2026-09-12 11:13:13 +02:00
1 parent e641500b40
commit f95bce01d1
8 files changed
+26 -22

No files matched your search

+10
View File
@@ -140,6 +140,16 @@ namespace montauk::abi {
return childPid;
}
// The calling process's own capability masks.
static int Sys_GetCaps(SpawnCapabilities* out) {
auto* proc = Sched::GetCurrentProcessPtr();
if (proc == nullptr || out == nullptr) return -1;
out->permitted = proc->permittedCaps;
out->effective = proc->effectiveCaps;
out->delegable = proc->delegableCaps;
return 0;
}
// Copy the absolute path this process was spawned from (argv[0]).
static int Sys_GetExecPath(char* buf, uint64_t maxLen) {
auto* proc = Sched::GetCurrentProcessPtr();