summaryrefslogtreecommitdiff
path: root/AK/MappedFile.cpp
AgeCommit message (Collapse)Author
2021-01-10AK: Make MappedFile heap-allocated and ref-countedAndreas Kling
Let's adapt this class a bit better to how it's actually being used. Instead of having valid/invalid states and storing an error in case it's invalid, a MappedFile is now always valid, and the factory function that creates it will return an OSError if mapping fails.
2020-10-08AK: Use new format functions.asynts
2020-08-30AK: Unbreak building with extra debug macrosBen Wiederhake
2020-08-01AK: Make MappedFile store why it is invalidAnotherTest
This makes AK::MappedFile save the errno either open() or mmap() failed with.
2020-07-31AK: On failed mmap, don't claim that there's a readable pageBen Wiederhake
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
2019-08-05AK: Do not keep an open FD in MmappedFileSergey Bugaev
We only need an open FD while establishing the mapping, and can close it immediately after mmap() call.
2019-07-08Kernel: Have the open() syscall take an explicit path length parameter.Andreas Kling
Instead of computing the path length inside the syscall handler, let the caller do that work. This allows us to implement to new variants of open() and creat(), called open_with_path_length() and creat_with_path_length(). These are suitable for use with e.g StringView.
2019-07-08MappedFile: Fix misuse of StringView::characters().Andreas Kling
This makes me wonder if the open() syscall should take characters+length and we'd compute the length at the LibC layer instead. That way we could also provide an optional non-POSIX open() that takes the length directly..
2019-06-03StringViewize a bunch of things -- mostly LibGUIRobin Burchell
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-18AK: MappedFile should open with O_CLOEXEC.Andreas Kling
2019-04-03PNGLoader: Use MappedFile.Andreas Kling
2019-04-03Font: Clean up AK::MappedFile and use it for mapping font files.Andreas Kling
2019-01-31Big, possibly complete sweep of naming changes.Andreas Kling
2018-10-16Start fixing up AK to work inside the kernel.Andreas Kling
2018-10-10Import all this stuff into a single repo called Serenity.Andreas Kling