How to map shared memory to fixed address on older linux (version < 4.17)
I’m using shared memory to share data between multiple processes that run my code (written in c).
The data I need to share is many interconnected structs that use pointers.
Since it will be tough to get rid of these pointers, I thought about mapping the shared memory into the same address on each process.
I’ve looked at the mmap’s man page and found the MAP_FIXED_NOREPLACE flag, which does exactly what I want.
However, it is only supported on kernel version 4.17+, which is sadly higher than the one I’m developing on.
Is there any safe (MAP_FIXED can override existing mapping) way to map shared memory to a fixed address on these lower versions?