From: Matthias Kruk Date: Thu, 2 Jan 2020 07:32:58 +0000 (+0900) Subject: Add _exit() syscall to klibc X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=d7669270b31585d427adb9b449727866160ca767;p=corax Add _exit() syscall to klibc --- diff --git a/include/unistd.h b/include/unistd.h index 4b87539..1724114 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -4,6 +4,7 @@ #include #include +extern void _exit(int); extern pid_t fork(void); extern pid_t vfork(void); extern int execfve(void*, const char**, const char**); diff --git a/kernel/klibc/posixcall.S b/kernel/klibc/posixcall.S index faa10f7..ecc6004 100644 --- a/kernel/klibc/posixcall.S +++ b/kernel/klibc/posixcall.S @@ -7,6 +7,7 @@ .section .text + .global _exit .global fork .global execfve .global brk @@ -14,6 +15,16 @@ .global mmap .global munmap +_exit: + pushl %ebx + + movl $SYS_EXIT, %eax + movl 8(%esp), %ebx + int $SYSCALL_POSIX + + popl %ebx + ret + fork: pushl %ebx