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