From 49be65eeba37a3d29a8a33379794e7a84df6cca1 Mon Sep 17 00:00:00 2001 From: Clément Chigot Date: Fri, 28 Sep 2018 15:24:32 +0200 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/syscall/exec_unix.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/syscall/exec_unix.go') 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]))) -- cgit v1.3-5-g9baa