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.
This commit is contained in:
Andreas Kling 2021-07-29 15:00:26 +02:00
parent efa9627fc4
commit 58b5a8f3c0
Notes: sideshowbarker 2024-07-18 07:47:56 +09:00

View file

@ -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));
}