mirror of https://github.com/golang/go.git
exp/ssa/interp: fix build for Plan 9
R=adonovan, minux.ma, alex.brainman, akumar, rminnich CC=golang-dev, lucio.dere https://golang.org/cl/7300078
This commit is contained in:
parent
2482ef7233
commit
edc3126e98
|
|
@ -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}
|
||||
}
|
||||
|
|
@ -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}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue