; // Override the clone syscall
#define clone _clone_raw
+#define _exit _exit_raw
#include "syscalls.s.h"
#undef clone
+#undef _exit
[global clone:func]
clone:
sub rsi, 3*8
.doCall:
mov eax, SYS_CLONE
- mov rdi, rsi ; Stack
- mov rsi, [rbp+2*8] ; Flags
SYSCALL_OP
mov [rel _errno], ebx
pop rbx
pop rbp
ret
+[global _exit:func]
+_exit:
+ xor eax, eax
+ SYSCALL_OP
+ jmp $
+
+; vim: ft=nasm
#include "common.h"
#include <stdint.h>
-#define DEBUG 1
+#define DEBUG 0
#if DEBUG
# define DEBUGS(v...) SysDebug(v)
// fprintf(stderr, "%02i: %p %s\n", i, gLoadedLibraries[i].Base, gLoadedLibraries[i].Name);\r
}\r
fprintf(stderr, "\n");\r
+ exit(-1);\r
return -1;\r
}\r
\r