-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Update, June 2 2021: The current proposed API is in #46084 (comment). - rsc
What did you expect to see?
It would be mildly useful to have shmget/shmat/shmdt/shmctl
available in pure go. System V shared memory isn't very common in modern applications, but there are still uses for it that can't be accomplished otherwise. Usages I'm aware of:
- X11 MIT-SHM extension uses shm to exchange image data
- The American Fuzzy Lop fuzzer uses shm as a mechanism to communicate with the program being fuzzed.
I think the primary question I'd like to have answered is whether inclusion is appropriate for x/sys/unix and how likely it would be for it to be accepted, given that its usage is fairly esoteric.
Prior art
There are several cgo implementations I had found previously, but my google-fu is failing me at the moment. I had proposed an initial API at golang/sys#108 , but hadn't noticed the other pure go prior art in my initial search. There are several mostly pure go implementations:
- https://github.com/gen2brain/shm provides a consistent higher level API for all of its supported OS, only requires cgo on solaris (see syscall: Syscall6 not implemented on Solaris #24357)
- https://github.com/nvi-inc/svipc is linux only and provides raw syscalls only
cc @gen2brain