aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/syscall_solaris.go
diff options
context:
space:
mode:
authorMichael MacInnis <michael.p.macinnis@gmail.com>2015-02-17 22:23:16 -0500
committerIan Lance Taylor <iant@golang.org>2015-03-23 15:35:53 +0000
commitf7befa43a3e5110379a85cabbbc999cf3b5fb9f6 (patch)
tree41a53d28077f9ff4f1ef94762d90dbcc273d5db9 /src/runtime/syscall_solaris.go
parent5bf9249edafa26eb2b4d7768a48e5ace8656a01a (diff)
downloadgo-f7befa43a3e5110379a85cabbbc999cf3b5fb9f6.tar.gz
go-f7befa43a3e5110379a85cabbbc999cf3b5fb9f6.zip
syscall: Add Foreground and Pgid to SysProcAttr
On Unix, when placing a child in a new process group, allow that group to become the foreground process group. Also, allow a child process to join a specific process group. When setting the foreground process group, Ctty is used as the file descriptor of the controlling terminal. Ctty has been added to the BSD and Solaris SysProcAttr structures and the handling of Setctty changed to match Linux. Change-Id: I18d169a6c5ab8a6a90708c4ff52eb4aded50bc8c Reviewed-on: https://go-review.googlesource.com/5130 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/syscall_solaris.go')
-rw-r--r--src/runtime/syscall_solaris.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/syscall_solaris.go b/src/runtime/syscall_solaris.go
index 9b99716747..440421d94c 100644
--- a/src/runtime/syscall_solaris.go
+++ b/src/runtime/syscall_solaris.go
@@ -16,6 +16,7 @@ var (
libc_fcntl,
libc_forkx,
libc_gethostname,
+ libc_getpid,
libc_ioctl,
libc_pipe,
libc_setgid,
@@ -184,6 +185,17 @@ func syscall_gethostname() (name string, err uintptr) {
}
//go:nosplit
+func syscall_getpid() (pid, err uintptr) {
+ call := libcall{
+ fn: uintptr(unsafe.Pointer(libc_getpid)),
+ n: 0,
+ args: uintptr(unsafe.Pointer(libc_getpid)), // it's unused but must be non-nil, otherwise crashes
+ }
+ asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
+ return call.r1, call.err
+}
+
+//go:nosplit
func syscall_ioctl(fd, req, arg uintptr) (err uintptr) {
call := libcall{
fn: uintptr(unsafe.Pointer(libc_ioctl)),