Commit f0939ba5 authored by Tobias Klauser's avatar Tobias Klauser Committed by Aram Hăvărneanu

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/100655Reviewed-by: 's avatarAram Hăvărneanu <aram@mgk.ro>
parent cd3aae9b
......@@ -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)),
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment