1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

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

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