1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:14:44 -07:00

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 <aram@mgk.ro>
This commit is contained in:
Tobias Klauser 2018-03-14 15:35:22 +00:00 committed by Aram Hăvărneanu
parent cd3aae9b81
commit f0939ba5b1
2 changed files with 9 additions and 6 deletions

View File

@ -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)),

View File

@ -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)