Skip to content

Commit 0f2dcba

Browse files
aykevldeadprogram
authored andcommitted
syscall: implement Exit call on unix
1 parent 94b8214 commit 0f2dcba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/runtime/runtime_unix.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ func malloc(size uintptr) unsafe.Pointer
1818
//go:export abort
1919
func abort()
2020

21+
//go:export exit
22+
func exit(code int)
23+
2124
//go:export clock_gettime
2225
func clock_gettime(clk_id uint, ts *timespec)
2326

@@ -75,3 +78,8 @@ func monotime() uint64 {
7578
func ticks() timeUnit {
7679
return timeUnit(monotime())
7780
}
81+
82+
//go:linkname syscall_Exit syscall.Exit
83+
func syscall_Exit(code int) {
84+
exit(code)
85+
}

0 commit comments

Comments
 (0)