summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/syscall_plan9.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/syscall/syscall_plan9.go')
-rw-r--r--src/pkg/syscall/syscall_plan9.go20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/pkg/syscall/syscall_plan9.go b/src/pkg/syscall/syscall_plan9.go
index 730126f23..4104050fd 100644
--- a/src/pkg/syscall/syscall_plan9.go
+++ b/src/pkg/syscall/syscall_plan9.go
@@ -35,7 +35,7 @@ var (
Stdout = 1
Stderr = 2
- EISDIR Error = NewError("file is a directory")
+ EISDIR = NewError("file is a directory")
)
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err string)
@@ -200,6 +200,17 @@ type Waitmsg struct {
Msg string
}
+func (w Waitmsg) Exited() bool { return true }
+func (w Waitmsg) Signaled() bool { return false }
+
+func (w Waitmsg) ExitStatus() int {
+ if len(w.Msg) == 0 {
+ // a normal exit returns no message
+ return 0
+ }
+ return 1
+}
+
//sys await(s []byte) (n int, err Error)
func Await(w *Waitmsg) (err Error) {
var buf [512]byte
@@ -230,7 +241,7 @@ func Await(w *Waitmsg) (err Error) {
w.Time[0] = uint32(atoi(f[1]))
w.Time[1] = uint32(atoi(f[2]))
w.Time[2] = uint32(atoi(f[3]))
- w.Msg = string(f[4])
+ w.Msg = cstring(f[4])
return
}
@@ -327,11 +338,6 @@ func Getgroups() (gids []int, err Error) {
return make([]int, 0), nil
}
-// TODO
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
- return -1, ENOSYS
-}
-
//sys Dup(oldfd int, newfd int) (fd int, err Error)
//sys Open(path string, mode int) (fd int, err Error)
//sys Create(path string, mode int, perm uint32) (fd int, err Error)