mirror of
https://github.com/golang/go
synced 2024-11-12 08:10:21 -07:00
exp/ssa: fix *bsd breakage.
Use portable ReadDirent, not linux Getdents. R=gri TBR=gri CC=golang-dev https://golang.org/cl/7405051
This commit is contained in:
parent
1c5e079600
commit
877153f04a
@ -70,7 +70,6 @@ var externals = map[string]externalFn{
|
||||
"syscall.Close": ext۰syscall۰Close,
|
||||
"syscall.Exit": ext۰syscall۰Exit,
|
||||
"syscall.Fstat": ext۰syscall۰Fstat,
|
||||
"syscall.Getdents": ext۰syscall۰Getdents,
|
||||
"syscall.Getpid": ext۰syscall۰Getpid,
|
||||
"syscall.Getwd": ext۰syscall۰Getwd,
|
||||
"syscall.Kill": ext۰syscall۰Kill,
|
||||
@ -78,6 +77,7 @@ var externals = map[string]externalFn{
|
||||
"syscall.Open": ext۰syscall۰Open,
|
||||
"syscall.ParseDirent": ext۰syscall۰ParseDirent,
|
||||
"syscall.Read": ext۰syscall۰Read,
|
||||
"syscall.ReadDirent": ext۰syscall۰ReadDirent,
|
||||
"syscall.Stat": ext۰syscall۰Stat,
|
||||
"syscall.Write": ext۰syscall۰Write,
|
||||
"time.Sleep": ext۰time۰Sleep,
|
||||
|
@ -15,9 +15,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value {
|
||||
func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Fstat not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Getdents(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Getdents not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Kill not yet implemented")
|
||||
}
|
||||
@ -33,6 +30,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value {
|
||||
func ext۰syscall۰Read(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Read not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.ReadDirent not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Stat not yet implemented")
|
||||
}
|
||||
|
@ -54,12 +54,12 @@ func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
|
||||
return wrapError(err)
|
||||
}
|
||||
|
||||
func ext۰syscall۰Getdents(fn *ssa.Function, args []value) value {
|
||||
// func GetDents(fd int, buf []byte) (n int, err error)
|
||||
func ext۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
|
||||
// func ReadDirent(fd int, buf []byte) (n int, err error)
|
||||
fd := args[0].(int)
|
||||
p := args[1].([]value)
|
||||
b := make([]byte, len(p))
|
||||
n, err := syscall.Getdents(fd, b)
|
||||
n, err := syscall.ReadDirent(fd, b)
|
||||
for i := 0; i < n; i++ {
|
||||
p[i] = b[i]
|
||||
}
|
||||
|
@ -16,9 +16,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value {
|
||||
func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Fstat not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Getdents(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Getdents not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Kill not yet implemented")
|
||||
}
|
||||
@ -34,6 +31,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value {
|
||||
func ext۰syscall۰Read(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Read not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.ReadDirent not yet implemented")
|
||||
}
|
||||
func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
|
||||
panic("syscall.Stat not yet implemented")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user