Commit Graph

21 Commits

Author SHA1 Message Date
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Patrick Meyer
0bd131ad06 Kernel: Stop requiring working malloc for syscall.h includes
Fixes #13869
2022-05-02 12:44:34 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
alexmajor
61f2b7434f syscall: Port to LibMain 2022-02-01 04:58:24 +00:00
sin-ack
69ef211925 Kernel+LibC: Move errno definitions to Kernel/API/POSIX
This fixes at least half of our LibC includes in the kernel. The source
of truth for errno codes and their description strings now lives in
Kernel/API/POSIX/errno.h as an enumeration, which LibC includes.
2021-12-16 22:21:35 +03:30
Andreas Kling
216e21a1fa AK: Convert AK::Format formatting helpers to returning ErrorOr<void>
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
2021-11-17 00:21:13 +01:00
Ben Wiederhake
99b8750154 syscall: Translate errno to something human-readable 2021-11-08 00:34:58 +01:00
Andreas Kling
af46f2214c Kernel: Make a bunch of "char const* to_string()" return StringView 2021-08-06 00:37:47 +02:00
Jean-Baptiste Boric
3038edab00 Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
Jean-Baptiste Boric
eecf7a2097 LibC: Move mman.h to sys/mman.h
POSIX mandates that it is placed there.
2021-05-14 22:24:02 +02:00
Brian Gianforcaro
072c264a04 Utilities: Fix the --list-syscalls option to syscall(1)
The 'syscall-arguments' positional arg being required was
breaking the scenario where the user just passes the
'--list-syscalls' argument.

Instead, make the argument not required, and manually handle
the error path our selves.

Closes: #6574
2021-04-23 13:24:39 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-04-22 11:22:27 +02:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...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-23 20:56:54 +01:00
Ben Wiederhake
fcda9ee7f5 Utilities: Fix embarassing typo in syscall(1) 2021-02-14 10:57:33 +01:00
Ben Wiederhake
9452281bec Tests: Merge and extend syscall tests into a syscall fuzzer
This found the previous bugs :^)
2021-02-13 00:40:31 +01:00
Ben Wiederhake
5963f2084e Utilities: Make syscall(1) explain what it's doing 2021-02-13 00:40:31 +01:00
Ben Wiederhake
cb9a9a3e03 Utilities: Enable syscall(1) to use SC_*_params buffers 2021-02-13 00:40:31 +01:00
Ben Wiederhake
244c81bcf2 Utilities: Make syscall(1) use Core::ArgsParser
Note that this should not change the behavior at all.
2021-02-13 00:40:31 +01:00
Andreas Kling
e87eac9273 Userland: Add LibSystem and funnel all syscalls through it
This achieves two things:

- Programs can now intentionally perform arbitrary syscalls by calling
  syscall(). This allows us to work on things like syscall fuzzing.

- It restricts the ability of userspace to make syscalls to a single
  4KB page of code. In order to call the kernel directly, an attacker
  must now locate this page and call through it.
2021-02-05 12:23:39 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00