golang/go

syscall: RawSyscall should panic on solaris

binarycrusader opened this issue · 2 comments

As noted in #20832, RawSyscall should panic on solaris as raw system calls are never actually possible on Solaris.

From syscall_solaris.go:

// This is syscall.RawSyscall, 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_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) {

From syscall/exec_solaris.go:

// We call hand-crafted syscalls, implemented in
// ../runtime/syscall_solaris.go, rather than generated libc wrappers
// because we need to avoid lazy-loading the functions (might malloc,
// split the stack, or acquire mutexes). We can't call RawSyscall
// because it's not safe even for BSD-subsystem calls.

Any existing use of RawSyscall should be excised first, and then it should be changed to panic on Solaris.

This is definitely for 1.10+

I'm an old Solarii from the ABI team who "owned" the standard libraries, if I can help with this, loop me in.

Change https://golang.org/cl/82636 mentions this issue: runtime: make RawSyscall panic on Solaris