ghetzel / shmtool Goto Github PK
View Code? Open in Web Editor NEWA command line utility for interacting with SysV-style shared memory segments, written in Golang. [Linux Only]
License: GNU Lesser General Public License v2.1
A command line utility for interacting with SysV-style shared memory segments, written in Golang. [Linux Only]
License: GNU Lesser General Public License v2.1
Hi there,
I'm trying to use this tool, but when I try running the sample code in the readme, I get the following errors:
# github.com/ghetzel/shmtool/shm
../../../go/src/github.com/ghetzel/shmtool/shm/shm.go:34:35: could not determine kind of name for C.SHM_HUGETLB
../../../go/src/github.com/ghetzel/shmtool/shm/shm.go:35:35: could not determine kind of name for C.SHM_NORESERVE
System details:
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/raghavkedia/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/raghavkedia/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f0/ml_0nj_d21b8mjrrvw473qcm0000gn/T/go-build006309853=/tmp/go-build -gno-record-gcc-switches -fno-common"
Any ideas why? I'm fairly new to golang...
Thanks!
In file included from src\github.com\ghetzel\shmtool\shm\shm.go:16:
./shm.h:5:10: fatal error: sys/shm.h: No such file or directory
#include <sys/shm.h>
^~~~~~~~~~~
compilation terminated.
Hi,
As far as i understand shared memory identifier could be zero so i think this check should change and check for a value of -1 to return "Cannot read shared memory segment: SHMID not set"
I could do a pull request if you agree!
Line 117 in d9c620f
Hello,
We are having some issues in our deployments with shmctl command. I would like to add the following errno switch in
Line 72 in 02b608a
e.g.
int sysv_shm_get_size(int shm_id) {
struct shmid_ds shm;
if(shmctl(shm_id, IPC_STAT, &shm) >= 0) {
return shm.shm_segsz;
}else{
switch(errno)
{
case EACCES:
return -1;
case EFAULT:
return -2;
case EIDRM:
return -3;
case EINVAL :
return -4;
case ENOMEM :
return -5;
case EOVERFLOW:
return -6;
case EPERM:
return -7;
default:
return 0;
}
}
}
Would you accept this as pull request and if you do, could you please let me know how I can push in a remote branch on your repo. I tried to create a pull request, but I am getting an access denied error.
Thank you!
https://github.com/ghetzel/shmtool/blob/master/shm/shm.go#L133
Should be making sure malloc
really malloc
'd. Noticed that while reading this:
https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html (#5)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.