Initializing shared memory using mmap() for a 2D array, is it necessary to also map memory for subsequent pointers? Should I use shm instead?
问题 I am using mmap() to initialize a shared memory space for parent and child processes and the object happens to be a double char pointer (i.e. char** ). It's necessary because I'm going to be storing user input to this 2D array in a child process and the parent will be accessing this same data after the child has terminated. It wasn't hard to work this out after reading a little bit of documentation on mmap() , and it feels a lot like malloc() , but less of a commitment. Consider the code