]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, syscall: add RawSyscall6 on Solaris and make it panic
authorTobias Klauser <tklauser@distanz.ch>
Wed, 14 Mar 2018 15:35:22 +0000 (15:35 +0000)
committerAram Hăvărneanu <aram@mgk.ro>
Wed, 14 Mar 2018 16:01:39 +0000 (16:01 +0000)
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>
src/runtime/syscall_solaris.go
src/syscall/asm_solaris_amd64.s

index ec83bd845b4b675c597503d12e64284eacb857ad..12afca17bb7aeaa4576c4b6df5a166cc75144b83 100644 (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)),
index 2547cdbef55564d60681e7fc86a871e267720b07..6fa041866d7f66c013e9a6211d99f4a01d3eeba8 100644 (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)