aboutsummaryrefslogtreecommitdiff
path: root/libgo/syscalls/wait4.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/syscalls/wait4.go')
-rw-r--r--libgo/syscalls/wait4.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/libgo/syscalls/wait4.go b/libgo/syscalls/wait4.go
new file mode 100644
index 0000000..bb00c79
--- /dev/null
+++ b/libgo/syscalls/wait4.go
@@ -0,0 +1,22 @@
+// wait4.go -- Wait4 for systems with wait4.
+
+// Copyright 2011 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 syscall
+
+func libc_wait4(Pid_t, *int, int, *Rusage) Pid_t __asm__ ("wait4")
+
+func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
+ var status int
+ r := libc_wait4(Pid_t(pid), &status, options, rusage)
+ wpid = int(r)
+ if r < 0 {
+ errno = GetErrno()
+ }
+ if wstatus != nil {
+ *wstatus = WaitStatus(status)
+ }
+ return
+}