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
+15
View File
@@ -0,0 +1,15 @@
#include <kernel/sysctl.h>
#include <errno.h>
// oldp, old_lenp and newp might be user pointers
int sysctl(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len) {
if (name_len < 2 || name_len > SYS_CTL_NAME_MAX)
return EINVAL;
switch (*name) {
case SYS_CTL_KERN:
return sysctl_kern(name + 1, name_len - 1, oldp, old_lenp, newp, new_len);
default:
return EINVAL;
}
}