diff options
author | Aram Hăvărneanu <aram@mgk.ro> | 2015-03-24 18:33:37 +0100 |
---|---|---|
committer | Aram Hăvărneanu <aram@mgk.ro> | 2015-03-24 19:51:21 +0000 |
commit | 41f9c430f3cc8c991981e5c6daa63f8718c800b9 (patch) | |
tree | 0094098003e1a50534b56cc418f522dd2e893615 /src/syscall/exec_solaris_test.go | |
parent | 75447d0623e3e7614a9cf9cdd5ece23d18028cab (diff) | |
download | go-git-41f9c430f3cc8c991981e5c6daa63f8718c800b9.tar.gz |
runtime, syscall: fix Solaris exec tests
Also fixes a long-existing problem in the fork/exec path.
Change-Id: Idec40b1cee0cfb1625fe107db3eafdc0d71798f2
Reviewed-on: https://go-review.googlesource.com/8030
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/syscall/exec_solaris_test.go')
-rw-r--r-- | src/syscall/exec_solaris_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/syscall/exec_solaris_test.go b/src/syscall/exec_solaris_test.go new file mode 100644 index 0000000000..123d9f1afb --- /dev/null +++ b/src/syscall/exec_solaris_test.go @@ -0,0 +1,29 @@ +// Copyright 2015 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. + +// +build solaris + +package syscall + +var ( + procGetpgid = modlibc.NewProc("getpgid") + procGetpgrp = modlibc.NewProc("getpgrp") +) + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := sysvicall6(procGetpgid.Addr(), 1, uintptr(pid), 0, 0, 0, 0, 0) + pgid = int(r0) + if e1 != 0 { + err = e1 + } + return +} + +func Getpgrp() (pgrp int) { + r0, _, _ := sysvicall6(procGetpgrp.Addr(), 0, 0, 0, 0, 0, 0, 0) + pgrp = int(r0) + return +} + +var Ioctl = ioctl |