diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-29 15:00:26 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-29 15:01:47 +0200 |
commit | 58b5a8f3c057abe88e44385bb64904894f8fc49a (patch) | |
tree | feb0f93eee4907f447904704cd27cda338aae1ca /AK | |
parent | efa9627fc4e4c22bc089f9914209e1ffac8c1243 (diff) | |
download | serenity-58b5a8f3c057abe88e44385bb64904894f8fc49a.zip |
AK: Update mmap name for MappedFiles on SerenityOS
Looking at process memory maps is a lot nicer when you can see the paths
of MappedFile mappings.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/MappedFile.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/MappedFile.cpp b/AK/MappedFile.cpp index 9c3199d0fe..3957d042a3 100644 --- a/AK/MappedFile.cpp +++ b/AK/MappedFile.cpp @@ -37,6 +37,12 @@ Result<NonnullRefPtr<MappedFile>, OSError> MappedFile::map(const String& path) if (ptr == MAP_FAILED) return OSError(errno); +#ifdef __serenity__ + if (set_mmap_name(ptr, size, path.characters()) < 0) { + perror("set_mmap_name"); + } +#endif + return adopt_ref(*new MappedFile(ptr, size)); } |