syscalls: implement sysctl and add process listing

This commit is contained in:
Matheus
2026-06-09 17:47:27 -03:00
parent 770a300618
commit 659b29ef4e
18 changed files with 428 additions and 8 deletions
+16
View File
@@ -51,6 +51,18 @@ static syscallret_t execve(context_t *context, char *upath, char *uargv[], char
return ret;
}
char *last_component = strrchr(path, '/');
if (last_component) {
++last_component;
if (*last_component == '\0') {
ret.errno = EISDIR;
free(path);
return ret;
}
} else {
last_component = path;
}
size_t argsize = 0;
size_t envsize = 0;
char **argv = NULL;
@@ -315,6 +327,10 @@ static syscallret_t execve(context_t *context, char *upath, char *uargv[], char
cred_doexec(&current_thread()->proc->cred, suid, sgid);
strncpy(current_thread()->proc->name, last_component, sizeof(current_thread()->proc->name));
proc->start_time = timekeeper_timefromboot();
memset(&proc->total_runtime, 0, sizeof(proc->total_runtime));
error:
free(path);
if (argv)