-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: Syscall6 not implemented on Solaris #24357
Comments
Someone just needs to implement |
/cc @binarycrusader @4ad I think syscalls are a bit different on Solaris and shouldn't be used directly. The comment above go/src/runtime/syscall_solaris.go Lines 238 to 243 in d32018a
Also, So I think the proper solution here would be to implement |
However, if you want |
I think we should an implementation of |
Why do we need I agree however that the "6" variants need to be added to As posted, the code would fail to compile on Plan 9, nacl, and possibly Windows too (unsure). That's ok, the author should be using build tags. Why is Solaris different than Plan 9, nacl or Windows? |
The problem now is that the syscall package currently declares Had It's not a big deal, though. |
You're right, it's declared by mistake. This is all my fault. When I wrote the Solaris port I intended the syscall package to only support the standard library, unlike the other Unix ports which export all kinds of functionality. Evidently, I failed. In this light I think defining all the declared, but undefined functions and making them panic is a good idea. |
Don't beat yourself up, it's a very easy mistake to make the way the code is written currently. |
Change https://golang.org/cl/100655 mentions this issue: |
Thanks @4ad and @ianlancetaylor for the clarification. I sent https://golang.org/cl/100655 which adds a |
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>
Thanks. So I should use for now And what about |
Until the XSI shared memory functions are added to As for FreeBSD, and any other Unix system, these functions should also go in |
Ok, for functions I understand, but I meant |
The Lines 21 to 28 in f0939ba
Instead, the |
@gen2brain It's totally fine to define some constant that exists only on some platform, though in this case note that you could just define generic shmget(2)-like functions that just use the underlying mechanism (shmget(2) on Solaris, SYS_SHMGET on some other platforms, etc), instead of exposing the lower-level mechanism itself. That way the calling code could stay portable and not care about the differences between platforms. |
Sorry, somehow I misread Ian's comment at #24357 (comment) and didn't add This will then also allow to add |
Change https://golang.org/cl/101135 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/milann/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/milann/golang"
GORACE=""
GOROOT="/home/milann/go"
GOTMPDIR=""
GOTOOLDIR="/home/milann/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build031994401=/tmp/go-build -gno-record-gcc-switches"
What did you do?
I am trying to call shmget, shmat etc. via syscall. On OpenSolaris there is one code for SHM (52) and then shmget etc. functions are sub calls with codes 0,1,2 etc.
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Program compiles ok with GOOS=solaris.
What did you see instead?
Is this something you are aware of and is there a workaround maybe? For now I also implemented cgo version but I hope just temporary. You can also test with library I am working on:
GOOS=solaris go get -tags syscall github.com/gen2brain/shm
The text was updated successfully, but these errors were encountered: