I am reading the source code of a paper. Mmap is used here. There is a 4kB page called 4kb.file. First, I use mmap to map this file multiple times.
ret = mmap((void *) target, PAGE, PROT_READ|PROT_WRITE, MAP_SHARED | MAP_FILE, fd, 0);
target is the starting address of the mapping I set. Use different target variable and call the above instruction multiple times. Is this file mapped to multiple locations in memory? Suppose that the return values of the above function executed multiple times are ret1, ret2, ret3, and ret4. Now I modify the content pointed to by ret1, will the positions of ret2, ret3... change (the same file is mapped to a different location)?
Is the first parameter in mmap, which is the target above, a virtual address? The source code always starts with 0x300000000000ULL. Does this number have any special meaning? Thanks