From: Tobias Klauser Date: Wed, 14 Mar 2018 15:35:22 +0000 (+0000) Subject: runtime, syscall: add RawSyscall6 on Solaris and make it panic X-Git-Tag: go1.11beta1~1211 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f0939ba5b18aea6649bf405dd6571030915afd56;p=gostls13.git runtime, syscall: add RawSyscall6 on Solaris and make it panic The syscall package currently declares RawSyscall6 for every GOOS, but does not define it on Solaris. This leads to code using said function to compile but it will not link. Fix it by adding RawSyscall6 and make it panic. Also remove the obsolete comment above runtime.syscall_syscall as pointed out by Aram. Updates #24357 Change-Id: I1b1423121d1c99de2ecc61cd9a935dba9b39e3a4 Reviewed-on: https://go-review.googlesource.com/100655 Reviewed-by: Aram Hăvărneanu --- diff --git a/src/runtime/syscall_solaris.go b/src/runtime/syscall_solaris.go index ec83bd845b..12afca17bb 100644 --- a/src/runtime/syscall_solaris.go +++ b/src/runtime/syscall_solaris.go @@ -180,6 +180,12 @@ func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) { panic("RawSyscall not available on Solaris") } +// This is syscall.RawSyscall6, it exists to avoid a linker error because +// syscall.RawSyscall6 is already declared. See golang.org/issue/24357 +func syscall_rawsyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) { + panic("RawSyscall6 not available on Solaris") +} + //go:nosplit func syscall_setgid(gid uintptr) (err uintptr) { call := libcall{ @@ -235,12 +241,6 @@ func syscall_setpgid(pid, pgid uintptr) (err uintptr) { return call.err } -// This is syscall.Syscall, it exists to satisfy some build dependency, -// but it doesn't work correctly. -// -// DO NOT USE! -// -// TODO(aram): make this panic once we stop calling fcntl(2) in net using it. func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) { call := libcall{ fn: uintptr(unsafe.Pointer(&libc_syscall)), diff --git a/src/syscall/asm_solaris_amd64.s b/src/syscall/asm_solaris_amd64.s index 2547cdbef5..6fa041866d 100644 --- a/src/syscall/asm_solaris_amd64.s +++ b/src/syscall/asm_solaris_amd64.s @@ -50,6 +50,9 @@ TEXT ·pipe(SB),NOSPLIT,$0 TEXT ·RawSyscall(SB),NOSPLIT,$0 JMP runtime·syscall_rawsyscall(SB) +TEXT ·RawSyscall6(SB),NOSPLIT,$0 + JMP runtime·syscall_rawsyscall6(SB) + TEXT ·setgid(SB),NOSPLIT,$0 JMP runtime·syscall_setgid(SB)