Skip to content

Commit

Permalink
Don't unlink shared memory on Unix
Browse files Browse the repository at this point in the history
Essentially adds the funcitonality from PR #6091 to Unix
platforms. This allows third party tools like DME and JuniorsToolbox
to access the shared memory region allowing them to manipulate game
memory for various functionality. To do this, keep the shared memory
object mapped to a name so that the other process can access it,
instead of unlinking it from the name right after creation. This might
leak files into the filesystem, like mentioned in
#9834 (comment),
but will only be one virtual file per dolphin so I think it's fine.
  • Loading branch information
HazardousPeach committed Sep 10, 2024
1 parent 5fe9e2f commit d8d8b5a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Source/Core/Common/MemArenaUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ void MemArena::GrabSHMSegment(size_t size, std::string_view base_name)
ERROR_LOG_FMT(MEMMAP, "shm_open failed: {}", strerror(errno));
return;
}
shm_unlink(file_name.c_str());
if (ftruncate(m_shm_fd, size) < 0)
ERROR_LOG_FMT(MEMMAP, "Failed to allocate low memory space");
}
Expand Down

0 comments on commit d8d8b5a

Please sign in to comment.