Andreas Kling
c1e18befe8
Kernel: Reorder sys$pipe() to fail more nicely
...
Try to do both FD allocations up front instead of interleaved between
assigning them to the descriptor table. This prevents us from failing
in the middle of setting up the pipes.
2021-09-05 16:25:40 +02:00
Andreas Kling
4483110990
Kernel: Use TRY() in sys$open()
2021-09-05 16:25:40 +02:00
Andreas Kling
b01e4b171d
Kernel: Use TRY() in sys$mknod()
2021-09-05 16:25:40 +02:00
Andreas Kling
2658ab4a80
Kernel: Use TRY() in sys$mkdir()
2021-09-05 16:25:40 +02:00
Andreas Kling
e899ea459c
Kernel: Use TRY() in sys$lseek()
2021-09-05 16:25:40 +02:00
Andreas Kling
f605cd04b6
Kernel: Use TRY() in sys$fork()
...
There's a lot of work to do on improving error propagation in the
fork system call. This just scratches the surface.
2021-09-05 16:25:40 +02:00
Andreas Kling
29bafec43b
Kernel: Use is_error() in sys$fcntl()
2021-09-05 16:25:40 +02:00
Andreas Kling
c767e20f91
Kernel: Use TRY() in sys$chown()
2021-09-05 16:25:40 +02:00
Andreas Kling
24e8ad5ade
Kernel: Use TRY() in sys$chmod()
2021-09-05 16:25:40 +02:00
Andreas Kling
3631ebe963
Kernel: Use TRY() in AnonymousVMObject
2021-09-05 16:25:40 +02:00
Andreas Kling
abb43468dc
Kernel: Use TRY() in FileDescription::attach()
2021-09-05 16:25:40 +02:00
Andreas Kling
aa4d5817af
Kernel: Use TRY() in sys$ptrace()
2021-09-05 16:25:40 +02:00
Andreas Kling
b2950c67ea
Kernel: Use TRY() in Inode
2021-09-05 16:25:40 +02:00
Andreas Kling
f20d1f0cc6
Kernel: Use TRY() in Region
2021-09-05 16:25:40 +02:00
Andreas Kling
c9a20bcd87
Kernel: Use TRY() in the SoundBlaster16 driver
2021-09-05 16:25:40 +02:00
Andreas Kling
4a2b0f6bec
Kernel: Use TRY() in sys$access()
2021-09-05 16:25:40 +02:00
Andreas Kling
c1c774da91
Kernel: Use TRY() in FIFO
2021-09-05 16:25:40 +02:00
Andreas Kling
cad78f5904
Kernel: Use TRY() in InodeFile
2021-09-05 16:25:40 +02:00
Andreas Kling
29a9f80ecf
Kernel/USB: Use TRY() in the various USB classes
2021-09-05 16:25:40 +02:00
Andreas Kling
f8fba5f017
Kernel: Use TRY() in sys$socket() and friends
2021-09-05 16:25:40 +02:00
Andreas Kling
8714c550b4
Kernel: Use TRY() in TCPSocket
2021-09-05 16:25:40 +02:00
FrHun
2a57cb19af
Emoji: Add various Emoji/Arrows
2021-09-05 14:49:47 +01:00
Andreas Kling
4b7575fabd
Kernel: Unbreak x86_64 build (PageDirectory)
2021-09-05 15:38:57 +02:00
Andreas Kling
865eb54f75
Kernel/Ext2FS: Use TRY() in the Ext2FS
...
This class was just *full* of great opportunities for TRY(). :^)
2021-09-05 15:30:15 +02:00
Andreas Kling
83fed5b2de
Kernel: Tidy up Memory::AddressSpace construction
...
- Return KResultOr<T> in places
- Propagate errors
- Use TRY()
2021-09-05 15:13:20 +02:00
Andreas Kling
0cf65cf7ec
Kernel: Use TRY() even more in VirtualFileSystem
...
Allowing TRY() with KResult unlocked a whole lot more opportunities.
2021-09-05 14:55:51 +02:00
Andreas Kling
e1af24eac8
Kernel: Make KResult usable with TRY() as well
...
This patch adds release_error() and release_value() to KResult, making
it usable with TRY().
Note that release_value() returns void, since there is no value inside
a KResult.
2021-09-05 14:50:52 +02:00
Andreas Kling
71187d865e
Kernel: Tidy up VirtualFileSystem::mount_root() a little bit
...
- Return KResult instead of bool
- Use TRY()
2021-09-05 14:46:44 +02:00
Andreas Kling
b0f2acbd91
Kernel: Use TRY() in FileDescription
2021-09-05 14:43:51 +02:00
Andreas Kling
f2f5df793a
Kernel: Use TRY() in sys$chdir()
2021-09-05 14:41:13 +02:00
Andreas Kling
5ba10c6017
Kernel: Use TRY() in Memory::AddressSpace
2021-09-05 14:40:18 +02:00
Andreas Kling
8cd4879946
Kernel: Use TRY() in sys$link() and sys$symlink()
2021-09-05 14:38:28 +02:00
Andreas Kling
c902b3cb0d
Kernel: Use TRY() in sys$anon_create()
2021-09-05 14:36:40 +02:00
Andreas Kling
4012099338
Kernel: Tidy up AnonymousFile construction a bit
...
- Rename create() => try_create()
- Use adopt_nonnull_ref_or_enomem()
2021-09-05 14:33:25 +02:00
Andreas Kling
9a1fdb523f
Kernel: Use TRY() in sys$unveil()
2021-09-05 14:30:08 +02:00
Andreas Kling
36efecf3c3
Kernel: Use try in sys$mmap() and friends :^)
2021-09-05 14:27:41 +02:00
Andreas Kling
6bf901b414
Kernel: Use TRY() in sys$execve()
...
There are more opportunities to use TRY() here, but it will require
improvements to error propagation first.
2021-09-05 14:20:03 +02:00
Andreas Kling
982991d92d
Kernel: Use TRY() in IPv4Socket
2021-09-05 14:16:08 +02:00
Andreas Kling
d65fbdc44d
Kernel: Use TRY() in Thread
2021-09-05 14:08:12 +02:00
Andreas Kling
ae885b188f
Kernel: Use TRY() when creating first thread in a new process
2021-09-05 14:08:12 +02:00
Andreas Kling
2ab8fd89fc
Kernel: Simplify Process::get_syscall_path_argument()
2021-09-05 14:08:12 +02:00
Andreas Kling
f30eae7e7a
Kernel: Use TRY() in some Process functions
2021-09-05 14:08:12 +02:00
Andreas Kling
81d3f823f7
Kernel: Use TRY() in LocalSocket
2021-09-05 14:08:12 +02:00
Andreas Kling
a5e71debef
Kernel: Use TRY() in VirtualFileSystem
2021-09-05 14:08:12 +02:00
Andreas Kling
e1da3b1841
Kernel: Make KResult pull in the TRY macro
2021-09-05 14:08:12 +02:00
Andreas Kling
b4d8e166d8
AK: Add a TRY(expression) macro to simplify the unwrap-or-return pattern
...
The way we use classes like Kernel::KResultOr<T> and AK::Result<T, E>
makes checking for errors (and short-circuiting returns) quite verbose.
This patch adds a new TRY(expression) macro that either evaluates to
the released result of the expression if successful, or returns the
error if not.
Before:
auto foo_or_error = get_foo();
if (foo_or_error.is_error())
return foo_or_error.release_error();
auto foo = foo_or_error.release_value();
After:
auto foo = TRY(get_foo());
The macro uses a GNU C++ extension which is supported by GCC, Clang,
Intel C++, and possibly others. It's not *ideal*, but since it makes our
codebase considerably nicer, let's try(!) it out. :^)
Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2021-09-05 14:08:12 +02:00
Andreas Kling
fd44336ef8
Kernel: Add KResultOr::release_error()
...
This is just for symmetry with AK::Result, so that we can use them
interchangeably in generic code.
2021-09-05 13:29:06 +02:00
Ali Mohammad Pur
09dd397160
LibWeb+LibWasm: Implement the WebAssembly.Table object
2021-09-05 15:42:50 +04:30
Ali Mohammad Pur
d52a26de3f
LibWasm: Move the vector size limit to Constants.h and increase it a bit
2021-09-05 15:42:50 +04:30
sin-ack
566c5d1e99
AK+Kernel: Move KResult.h to Kernel/API for userspace access
...
This commit moves the KResult and KResultOr objects to Kernel/API to
signify that they may now be freely used by userspace code at points
where a syscall-related error result is to be expected. It also exposes
KResult and KResultOr to the global namespace to make it nicer to use
for userspace code.
2021-09-05 12:54:48 +02:00