Safe values to be used as key in shmget
c++, key, linux, shared-memory
Solution
I suggest you use the POSIX `shm_open` (with `mmap`) instead, It doesn't have the problem of collisions that exists with `ftok` so long as you aren't using the same named region as other software.
Problem
I'm using shmget for sharing data between processes of my project on Linux. ``` int shmget(key_t key, size_t size, int shmflg); ``` However, any other programs can call to shmget too, and thus it may lead to key conflict (because I use a constant as the key to call shmget, I must use a constant instead of a generated key because the lateral processes are built and run separately). What should be the safe values to be used as key in shmget?