Skip to content
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

Attach'ing problem relevant with flags IPC_CREAT | IPC_EXCL #9

Open
enseitankado opened this issue Jun 15, 2020 · 0 comments
Open

Attach'ing problem relevant with flags IPC_CREAT | IPC_EXCL #9

enseitankado opened this issue Jun 15, 2020 · 0 comments

Comments

@enseitankado
Copy link

enseitankado commented Jun 15, 2020

There is no attach method for outside of node.js environments. I created a SHM in C++ but the node cant attach with it. To have access to shm, it must have created it own.

Another problem is: I'm creating a shm with a key and can reading in same execution session but I start a new execution with same key to read previous data then create method returns null and failing. Because of theresi is no attach method and create method already has IPC_EXCL flag.

Please your attention:

res = shm.get(key, count, shm.IPC_CREAT|shm.IPC_EXCL|perm, 0, type);

I think that if second flag (IPC_EXCL) will be ommitted from create method then the problem above solved and the create method can create a new and can attach already one.

Also, if we consider the server environment safe, the permissions must be set to 666 for another program to read and write.

Ref: https://man7.org/linux/man-pages/man2/shmget.2.html

@enseitankado enseitankado changed the title Attach'in problem Attach'ing problem relevant with flags IPC_CREAT | IPC_EXCL Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant