after mapping the file to memory, how do i read the file from another program?
size_t getFilesize(const char* filename) { ...... }
int main(int argc, char** argv) {
size_t filesize = getFilesize(argv[1]);
int fd = open(argv[1], O_RDONLY, 0);
void* mmappedData = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE | MAP_POPULATE, fd, 0);
system("/usr/bin/gnome-terminal program_B")
}
so that the file mapped in program A can be shown in a new pop-up terminal(exec program B)
also i don't know if the system(".......") is correct or not