runtime/internal/lib/os: fix readdir for darwin-amd64
This commit is contained in:
17
runtime/internal/clite/os/dir.go
Normal file
17
runtime/internal/clite/os/dir.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
|
||||
c "github.com/goplus/llgo/runtime/internal/clite"
|
||||
)
|
||||
|
||||
type DIR struct {
|
||||
Unused [0]byte
|
||||
}
|
||||
|
||||
//go:linkname Opendir C.opendir
|
||||
func Opendir(name *c.Char) *DIR
|
||||
|
||||
//go:linkname Closedir C.closedir
|
||||
func Closedir(dir *DIR) c.Int
|
||||
17
runtime/internal/clite/os/dir_darwin_amd64.go
Normal file
17
runtime/internal/clite/os/dir_darwin_amd64.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
|
||||
c "github.com/goplus/llgo/runtime/internal/clite"
|
||||
"github.com/goplus/llgo/runtime/internal/clite/syscall"
|
||||
)
|
||||
|
||||
//go:linkname Fdopendir C.fdopendir$INODE64
|
||||
func Fdopendir(fd c.Int) *DIR
|
||||
|
||||
//go:linkname Readdir C.readdir$INODE64
|
||||
func Readdir(dir *DIR) *syscall.Dirent
|
||||
|
||||
//go:linkname Fstatat C.fstatat$INODE64
|
||||
func Fstatat(dirfd c.Int, path *c.Char, buf *StatT, flags c.Int) c.Int
|
||||
20
runtime/internal/clite/os/dir_unix.go
Normal file
20
runtime/internal/clite/os/dir_unix.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build !(darwin && amd64)
|
||||
// +build !darwin !amd64
|
||||
|
||||
package os
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
|
||||
c "github.com/goplus/llgo/runtime/internal/clite"
|
||||
"github.com/goplus/llgo/runtime/internal/clite/syscall"
|
||||
)
|
||||
|
||||
//go:linkname Fdopendir C.fdopendir
|
||||
func Fdopendir(fd c.Int) *DIR
|
||||
|
||||
//go:linkname Readdir C.readdir
|
||||
func Readdir(dir *DIR) *syscall.Dirent
|
||||
|
||||
//go:linkname Fstatat C.fstatat
|
||||
func Fstatat(dirfd c.Int, path *c.Char, buf *StatT, flags c.Int) c.Int
|
||||
@@ -135,9 +135,6 @@ func Fchmodat(dirfd c.Int, path *c.Char, mode ModeT, flags c.Int) c.Int
|
||||
//go:linkname Fchownat C.fchownat
|
||||
func Fchownat(dirfd c.Int, path *c.Char, owner UidT, group GidT, flags c.Int) c.Int
|
||||
|
||||
//go:linkname Fstatat C.fstatat
|
||||
func Fstatat(dirfd c.Int, path *c.Char, buf *StatT, flags c.Int) c.Int
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
//go:linkname Open C.open
|
||||
@@ -191,9 +188,6 @@ func Fchmod(fd c.Int, mode ModeT) c.Int
|
||||
//go:linkname Fchown C.fchown
|
||||
func Fchown(fd c.Int, owner UidT, group GidT) c.Int
|
||||
|
||||
//go:linkname Fstat C.fstat
|
||||
func Fstat(fd c.Int, buf *StatT) c.Int
|
||||
|
||||
//go:linkname Isatty C.isatty
|
||||
func Isatty(fd c.Int) c.Int
|
||||
|
||||
|
||||
@@ -14,3 +14,6 @@ func Stat(path *c.Char, buf *StatT) c.Int
|
||||
|
||||
//go:linkname Lstat C.lstat
|
||||
func Lstat(path *c.Char, buf *StatT) c.Int
|
||||
|
||||
//go:linkname Fstat C.fstat
|
||||
func Fstat(fd c.Int, buf *StatT) c.Int
|
||||
|
||||
@@ -11,3 +11,6 @@ func Stat(path *c.Char, buf *StatT) c.Int
|
||||
|
||||
//go:linkname Lstat C.lstat64
|
||||
func Lstat(path *c.Char, buf *StatT) c.Int
|
||||
|
||||
//go:linkname Fstat C.fstat64
|
||||
func Fstat(fd c.Int, buf *StatT) c.Int
|
||||
|
||||
Reference in New Issue
Block a user