darwin: fix syscall.Open on darwin/arm64

Unfortunately the calling convention for variadic functions is different from
the calling convention of regular functions on darwin/arm64, and open happens
to be such a variadic function. The syscall package treated it like a regular
function, which resulted in buggy behavior.

This fix introduces a wrapper function. This is the cleanest change I could
come up with.
This commit is contained in:
Ayke van Laethem
2022-10-09 15:56:18 +02:00
committed by Ron Evans
parent 2072d1bb5c
commit 7e9d84777e
6 changed files with 24 additions and 5 deletions
-5
View File
@@ -351,11 +351,6 @@ func libc_pread(fd int32, buf *byte, count uint, offset int64) int
//export lseek
func libc_lseek(fd int32, offset int64, whence int) int64
// int open(const char *pathname, int flags, mode_t mode);
//
//export open
func libc_open(pathname *byte, flags int32, mode uint32) int32
// int close(int fd)
//
//export close