I would like to pass a pointer (I am putting a file with data in memory with mmap) to processes spawned using fork + exec, but I am stuck on how to pass a pointer to the exec()
Consider passing the offset to the memory within the file to the child process. If the offset is zero, then don't bother, but if you need to pass a 'pointer' to part way through the file, then convert that to an offset from the start address, and pass that to the child. The child can then get to the data by adding the offset to the address it obtains for the mapped file.