2022-12-14 16:50:10 +03:00
|
|
|
#include "../syscall.h"
|
|
|
|
|
|
2022-11-21 01:50:02 +03:00
|
|
|
int main();
|
|
|
|
|
|
2022-12-14 16:50:10 +03:00
|
|
|
int syscall(int call, int arg) {
|
|
|
|
|
asm("int $0x84": "+a"(call) : "b"(arg));
|
|
|
|
|
return call;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-13 01:25:27 +03:00
|
|
|
_Noreturn
|
2022-12-13 00:51:05 +03:00
|
|
|
void _exit(int exit_status) {
|
2022-12-14 16:50:10 +03:00
|
|
|
syscall(SYS_exit, exit_status);
|
2022-12-13 01:25:27 +03:00
|
|
|
__builtin_unreachable();
|
2022-12-13 00:51:05 +03:00
|
|
|
}
|
|
|
|
|
|
2022-11-21 01:50:02 +03:00
|
|
|
void _start() {
|
2022-12-13 00:51:05 +03:00
|
|
|
_exit(main());
|
2022-11-21 01:50:02 +03:00
|
|
|
}
|