]> Cypherpunks repositories - gostls13.git/commitdiff
exp/ssa/interp: fix build for Plan 9
authorAnthony Martin <ality@pbrane.org>
Fri, 22 Feb 2013 04:06:26 +0000 (20:06 -0800)
committerAnthony Martin <ality@pbrane.org>
Fri, 22 Feb 2013 04:06:26 +0000 (20:06 -0800)
R=adonovan, minux.ma, alex.brainman, akumar, rminnich
CC=golang-dev, lucio.dere
https://golang.org/cl/7300078

src/pkg/exp/ssa/interp/external_plan9.go [new file with mode: 0644]
src/pkg/exp/ssa/interp/external_unix.go

diff --git a/src/pkg/exp/ssa/interp/external_plan9.go b/src/pkg/exp/ssa/interp/external_plan9.go
new file mode 100644 (file)
index 0000000..5f17cac
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright 2013 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package interp
+
+import (
+       "exp/ssa"
+       "syscall"
+)
+
+func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
+       panic("syscall.Kill not yet implemented")
+}
+
+func ext۰syscall۰Write(fn *ssa.Function, args []value) value {
+       // We could emulate syscall.Syscall but it's more effort.
+       p := args[1].([]value)
+       b := make([]byte, 0, len(p))
+       for i := range p {
+               b = append(b, p[i].(byte))
+       }
+       n, _ := syscall.Write(args[0].(int), b)
+       err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted iface.
+       return tuple{n, err}
+}
index e021ff7214878360c16970b1523a74d93a43258a..afc874535fb4b3a6e13320c557c9a93ce9124e77 100644 (file)
@@ -28,5 +28,4 @@ func ext۰syscall۰Write(fn *ssa.Function, args []value) value {
        n, _ := syscall.Write(args[0].(int), b)
        err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted iface.
        return tuple{n, err}
-
 }