Commit 877153f0 authored by Alan Donovan's avatar Alan Donovan

exp/ssa: fix *bsd breakage.

Use portable ReadDirent, not linux Getdents.

R=gri
TBR=gri
CC=golang-dev
https://golang.org/cl/7405051
parent 1c5e0796
...@@ -70,7 +70,6 @@ var externals = map[string]externalFn{ ...@@ -70,7 +70,6 @@ var externals = map[string]externalFn{
"syscall.Close": ext۰syscall۰Close, "syscall.Close": ext۰syscall۰Close,
"syscall.Exit": ext۰syscall۰Exit, "syscall.Exit": ext۰syscall۰Exit,
"syscall.Fstat": ext۰syscall۰Fstat, "syscall.Fstat": ext۰syscall۰Fstat,
"syscall.Getdents": ext۰syscall۰Getdents,
"syscall.Getpid": ext۰syscall۰Getpid, "syscall.Getpid": ext۰syscall۰Getpid,
"syscall.Getwd": ext۰syscall۰Getwd, "syscall.Getwd": ext۰syscall۰Getwd,
"syscall.Kill": ext۰syscall۰Kill, "syscall.Kill": ext۰syscall۰Kill,
...@@ -78,6 +77,7 @@ var externals = map[string]externalFn{ ...@@ -78,6 +77,7 @@ var externals = map[string]externalFn{
"syscall.Open": ext۰syscall۰Open, "syscall.Open": ext۰syscall۰Open,
"syscall.ParseDirent": ext۰syscall۰ParseDirent, "syscall.ParseDirent": ext۰syscall۰ParseDirent,
"syscall.Read": ext۰syscall۰Read, "syscall.Read": ext۰syscall۰Read,
"syscall.ReadDirent": ext۰syscall۰ReadDirent,
"syscall.Stat": ext۰syscall۰Stat, "syscall.Stat": ext۰syscall۰Stat,
"syscall.Write": ext۰syscall۰Write, "syscall.Write": ext۰syscall۰Write,
"time.Sleep": ext۰time۰Sleep, "time.Sleep": ext۰time۰Sleep,
......
...@@ -15,9 +15,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value { ...@@ -15,9 +15,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value {
func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value { func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
panic("syscall.Fstat not yet implemented") 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 { func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
panic("syscall.Kill not yet implemented") panic("syscall.Kill not yet implemented")
} }
...@@ -33,6 +30,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value { ...@@ -33,6 +30,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value {
func ext۰syscall۰Read(fn *ssa.Function, args []value) value { func ext۰syscall۰Read(fn *ssa.Function, args []value) value {
panic("syscall.Read not yet implemented") 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 { func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
panic("syscall.Stat not yet implemented") panic("syscall.Stat not yet implemented")
} }
......
...@@ -54,12 +54,12 @@ func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value { ...@@ -54,12 +54,12 @@ func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
return wrapError(err) return wrapError(err)
} }
func ext۰syscall۰Getdents(fn *ssa.Function, args []value) value { func ext۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
// func GetDents(fd int, buf []byte) (n int, err error) // func ReadDirent(fd int, buf []byte) (n int, err error)
fd := args[0].(int) fd := args[0].(int)
p := args[1].([]value) p := args[1].([]value)
b := make([]byte, len(p)) b := make([]byte, len(p))
n, err := syscall.Getdents(fd, b) n, err := syscall.ReadDirent(fd, b)
for i := 0; i < n; i++ { for i := 0; i < n; i++ {
p[i] = b[i] p[i] = b[i]
} }
......
...@@ -16,9 +16,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value { ...@@ -16,9 +16,6 @@ func ext۰syscall۰Close(fn *ssa.Function, args []value) value {
func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value { func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
panic("syscall.Fstat not yet implemented") 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 { func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
panic("syscall.Kill not yet implemented") panic("syscall.Kill not yet implemented")
} }
...@@ -34,6 +31,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value { ...@@ -34,6 +31,9 @@ func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value {
func ext۰syscall۰Read(fn *ssa.Function, args []value) value { func ext۰syscall۰Read(fn *ssa.Function, args []value) value {
panic("syscall.Read not yet implemented") 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 { func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
panic("syscall.Stat not yet implemented") panic("syscall.Stat not yet implemented")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment