]> git.corax.cc Git - corax/commitdiff
Add _exit() syscall to klibc
authorMatthias Kruk <m@m10k.eu>
Thu, 2 Jan 2020 07:32:58 +0000 (16:32 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 2 Jan 2020 07:32:58 +0000 (16:32 +0900)
include/unistd.h
kernel/klibc/posixcall.S

index 4b87539a4c218f6554834144e8b4267c2e55323a..17241143122daa4e45739f5035c287ecefe23add 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/types.h>
 #include <corax/types.h>
 
+extern void _exit(int);
 extern pid_t fork(void);
 extern pid_t vfork(void);
 extern int execfve(void*, const char**, const char**);
index faa10f7209a505b75fdb598253c4ca79eee6f80d..ecc60041bb472ea6060dba88352ab931b258e05c 100644 (file)
@@ -7,6 +7,7 @@
 
        .section .text
 
+       .global _exit
        .global fork
        .global execfve
        .global brk
        .global mmap
        .global munmap
 
+_exit:
+       pushl   %ebx
+
+       movl    $SYS_EXIT, %eax
+       movl    8(%esp), %ebx
+       int             $SYSCALL_POSIX
+
+       popl    %ebx
+       ret
+
 fork:
        pushl   %ebx