github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/syscall/syscall_libc_darwin_amd64.go (about) 1 //go:build darwin 2 3 package syscall 4 5 import ( 6 "unsafe" 7 ) 8 9 // The odd $INODE64 suffix is an Apple compatibility feature, see 10 // __DARWIN_INODE64 in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h 11 // and https://assert.cc/posts/darwin_use_64_bit_inode_vs_ctypes/ 12 // Without it, you get the old, smaller struct stat from mac os 10.2 or so. 13 // It not needed on arm64. 14 15 // struct DIR * buf fdopendir(int fd); 16 // 17 //export fdopendir$INODE64 18 func libc_fdopendir(fd int32) unsafe.Pointer 19 20 // int closedir(struct DIR * buf); 21 // 22 //export closedir 23 func libc_closedir(unsafe.Pointer) int32 24 25 // int readdir_r(struct DIR * buf, struct dirent *entry, struct dirent **result); 26 // 27 //export readdir_r$INODE64 28 func libc_readdir_r(unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32 29 30 // int stat(const char *path, struct stat * buf); 31 // 32 //export stat$INODE64 33 func libc_stat(pathname *byte, ptr unsafe.Pointer) int32 34 35 // int fstat(int fd, struct stat * buf); 36 // 37 //export fstat$INODE64 38 func libc_fstat(fd int32, ptr unsafe.Pointer) int32 39 40 // int lstat(const char *path, struct stat * buf); 41 // 42 //export lstat$INODE64 43 func libc_lstat(pathname *byte, ptr unsafe.Pointer) int32