Move e_pid and e_pgid to libprocess, Add get_self_pid () syscall
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m13s

This commit is contained in:
2026-03-17 22:13:01 +01:00
parent 090a4e46ea
commit 7bcd40151d
14 changed files with 69 additions and 26 deletions

View File

@@ -1022,6 +1022,17 @@ DEFINE_SYSCALL (sys_env_get) {
return SYSRESULT (proc_env_set (target_procgroup, key, buffer, size));
}
/* int get_self_pid (void) */
DEFINE_SYSCALL (sys_get_self_pid) {
uint64_t fp;
spin_lock (&proc->lock, &fp);
int pid = proc->pid;
spin_unlock (&proc->lock, fp);
return SYSRESULT (pid);
}
static syscall_handler_func_t handler_table[] = {
[SYS_QUIT] = &sys_quit,
[SYS_TEST] = &sys_test,
@@ -1057,6 +1068,7 @@ static syscall_handler_func_t handler_table[] = {
[SYS_EXEC_PARTIAL] = &sys_exec_partial,
[SYS_EXEC_PARTIAL_FINI] = &sys_exec_partial_fini,
[SYS_MAIL_RECEIVE_NONBLOCK] = &sys_mail_receive_nonblock,
[SYS_GET_SELF_PID] = &sys_get_self_pid,
};
syscall_handler_func_t syscall_find_handler (int syscall_num) {