syscalls: add getpid syscall
This commit is contained in:
@@ -230,6 +230,11 @@ int sys_close(TrapFrame *tf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sys_getpid(TrapFrame *tf)
|
||||
{
|
||||
return current->pid;
|
||||
}
|
||||
|
||||
void handle_syscall(TrapFrame *tf)
|
||||
{
|
||||
/*
|
||||
@@ -262,6 +267,10 @@ void handle_syscall(TrapFrame *tf)
|
||||
case 6://close
|
||||
tf->eax = sys_close(tf);
|
||||
break;
|
||||
|
||||
case 20://getpid
|
||||
tf->eax = sys_getpid(tf);
|
||||
break;
|
||||
default:
|
||||
debug_log("unknown syscall: %X\n", tf->eax);
|
||||
tf->eax = -1;
|
||||
|
||||
Reference in New Issue
Block a user