diff options
author | Clément Chigot <clement.chigot@atos.net> | 2018-09-28 15:24:32 +0200 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-10-10 00:58:17 +0000 |
commit | 49be65eeba37a3d29a8a33379794e7a84df6cca1 (patch) | |
tree | 39e002eebf6012e68bc1b265a70329a03b3403d1 /src/syscall/exec_unix.go | |
parent | dc2ae2886fbcd2297d2a0ea67a5d220ae2c74152 (diff) | |
download | go-git-49be65eeba37a3d29a8a33379794e7a84df6cca1.tar.gz |
syscall: change solaris files to libc files
AIX and Solaris both requires libc to make any syscalls and their
implementation is really similar.
Therefore, Solaris files reused by AIX have their name changed to *_libc.
exec_libc.go is also adapted to AIX.
Updates: #25893
Change-Id: I50d1d7b964831637013d5e64799187cd9565c42b
Reviewed-on: https://go-review.googlesource.com/c/138719
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/exec_unix.go')
-rw-r--r-- | src/syscall/exec_unix.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go index 9a950ac17f..3b84256b8e 100644 --- a/src/syscall/exec_unix.go +++ b/src/syscall/exec_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // Fork, exec, wait, etc. @@ -246,9 +246,9 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle func runtime_BeforeExec() func runtime_AfterExec() -// execveSolaris is non-nil on Solaris, set to execve in exec_solaris.go; this +// execveLibc is non-nil on OS using libc syscall, set to execve in exec_libc.go; this // avoids a build dependency for other platforms. -var execveSolaris func(path uintptr, argv uintptr, envp uintptr) (err Errno) +var execveLibc func(path uintptr, argv uintptr, envp uintptr) (err Errno) // Exec invokes the execve(2) system call. func Exec(argv0 string, argv []string, envv []string) (err error) { @@ -267,9 +267,9 @@ func Exec(argv0 string, argv []string, envv []string) (err error) { runtime_BeforeExec() var err1 Errno - if runtime.GOOS == "solaris" { - // RawSyscall should never be used on Solaris. - err1 = execveSolaris( + if runtime.GOOS == "solaris" || runtime.GOOS == "aix" { + // RawSyscall should never be used on Solaris or AIX. + err1 = execveLibc( uintptr(unsafe.Pointer(argv0p)), uintptr(unsafe.Pointer(&argvp[0])), uintptr(unsafe.Pointer(&envvp[0]))) |