summaryrefslogtreecommitdiff
path: root/AK/MappedFile.cpp
AgeCommit message (Collapse)Author
2021-08-07AK: Use east const in MappedFileTimothy
2021-08-07AK: Add method to create MappedFile from fdTimothy
2021-07-29AK: Update mmap name for MappedFiles on SerenityOSAndreas Kling
Looking at process memory maps is a lot nicer when you can see the paths of MappedFile mappings.
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-08Everywhere: Remove unnecessary headers 1/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous). My favorite #include: #include "Applications/Piano/Music.h" // You can't have too much music in life!
2021-01-12LibC+Everywhere: Remove open_with_path_length() in favor of open()Andreas Kling
This API was a mostly gratuitous deviation from POSIX that gave up some portability in exchange for avoiding the occasional strlen(). I don't think that was actually achieving anything valuable, so let's just chill out and have the same open() API as everyone else. :^)
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