]> Cypherpunks repositories - gostls13.git/commitdiff
exp/ssa: fix *bsd breakage.
authorAlan Donovan <adonovan@google.com>
Wed, 27 Feb 2013 22:00:02 +0000 (17:00 -0500)
committerAlan Donovan <adonovan@google.com>
Wed, 27 Feb 2013 22:00:02 +0000 (17:00 -0500)
Use portable ReadDirent, not linux Getdents.

R=gri
TBR=gri
CC=golang-dev
https://golang.org/cl/7405051

src/pkg/exp/ssa/interp/external.go
src/pkg/exp/ssa/interp/external_plan9.go
src/pkg/exp/ssa/interp/external_unix.go
src/pkg/exp/ssa/interp/external_windows.go

index 25b012eed38ea4ddbea2d3c95b503e36b5d9f354..e1e89d24754cbd6046a46dffbff1ff2715266499 100644 (file)
@@ -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,
index ce7fd529b1f9672fca6663b55ed1aff2a4f5b1bf..f7d2a4b300853773681b484d08ea177fb07487f3 100644 (file)
@@ -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")
 }
index c81454ae26633b08325f6e1ac25dfbb987ece01c..d6875cb88b20be713b3544899392c0971dec8263 100644 (file)
@@ -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]
        }
index 9b782ea1a6f2f42a1b3d522aa4340ded080a920e..86137d4b3d3532d416d024c0308e8baa3ce9d4aa 100644 (file)
@@ -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")
 }