src/os/linux/vm/os_linux.cpp

Print this page

        

*** 4688,4705 **** // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, bool allow_exec) { int prot; ! int flags; if (read_only) { prot = PROT_READ; - flags = MAP_SHARED; } else { prot = PROT_READ | PROT_WRITE; - flags = MAP_PRIVATE; } if (allow_exec) { prot |= PROT_EXEC; } --- 4688,4703 ---- // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, bool allow_exec) { int prot; ! int flags = MAP_PRIVATE; if (read_only) { prot = PROT_READ; } else { prot = PROT_READ | PROT_WRITE; } if (allow_exec) { prot |= PROT_EXEC; }