Commit Graph

9 Commits

Author SHA1 Message Date
Andreas Kling
dd82f68326 Kernel: Use KString all the way in sys$execve()
This patch converts all the usage of AK::String around sys$execve() to
using KString instead, allowing us to catch and propagate OOM errors.

It also required changing the kernel CommandLine helper class to return
a vector of KString for the userspace init program arguments.
2021-09-09 21:25:10 +02:00
Andreas Kling
300402cc14 Kernel: Make it possible for KBufferBuilder creation to fail
This patch adds KBufferBuilder::try_create() and treats it like anything
else that can fail. And so, failure to allocate the initial internal
buffer of the builder will now propagate an ENOMEM to the caller. :^)
2021-09-07 15:54:23 +02:00
Andreas Kling
4a9c18afb9 Kernel: Rename FileDescription => OpenFileDescription
Dr. POSIX really calls these "open file description", not just
"file description", so let's call them exactly that. :^)
2021-09-07 13:53:14 +02:00
Andreas Kling
69b9b2888c Kernel: Don't allocate so much when generating coredumps
Instead of creating a bunch of ByteBuffers and concatenating them to
generate the "notes" segment, we now simply create a KBufferBuilder
and tell each of the notes generator helpers to write into the builder.

This allows the code to flow more naturally, with some bonus additional
error propagation. :^)
2021-09-06 18:56:51 +02:00
Andreas Kling
60eea6940f Kernel: Tidy up Coredump construction
- Use KResultOr and TRY to propagate errors
- Return more specific errors now that they have a path out from here
2021-09-06 18:56:51 +02:00
Andreas Kling
c11c0fe453 Kernel: Use TRY() in Coredump 2021-09-06 18:56:51 +02:00
Andreas Kling
f16b9a691f Kernel: Rename ProcessPagingScope => ScopedAddressSpaceSwitcher 2021-09-06 18:56:51 +02:00
Ali Mohammad Pur
3a9f00c59b Everywhere: Use OOM-safe ByteBuffer APIs where possible
If we can easily communicate failure, let's avoid asserting and report
failure instead.
2021-09-06 01:53:26 +02:00
Andreas Kling
bcd2025311 Everywhere: Core dump => Coredump
We all know what a coredump is, and it feels more natural to refer to
it as a coredump (most code already does), so let's be consistent.
2021-08-23 00:02:09 +02:00