Commit graph

11931 commits

Author SHA1 Message Date
AnotherTest
1222be7e3a HackStudio: Set the pgrp of the pseudoterminal to the child pid
This fixes #3046.
2020-08-09 11:33:15 +02:00
Brian Gianforcaro
34dd8edcb3 Kernel: Decorate KResult and KResultOr<T> methods with [[nodiscard]]
This would have found my error propagation bug.
2020-08-09 00:13:39 +02:00
Brian Gianforcaro
fe64d97001 Kernel: Fix my result propagation bug @BenWiederhake spotted
In #3001 I was trying to fix result propagation issues, and
I actually just introduced another one. Luckily Ben spotted
it in the diff after it was in the tree, thanks Ben!
2020-08-09 00:13:39 +02:00
AnotherTest
7ebba7bf3c open: Resolve the realpath before passing it to URL()
...which runs it through LexicalPath.
Fixes #3016.
2020-08-08 11:58:57 +02:00
Andreas Kling
62ec42c112 LibWeb: Remove some unnecessary throwaway strings in the CSS parser
We've had StringView::ends_with(..., CaseSensitivity) for a while,
so let's use it to avoid creating a bunch of unnecessary strings here.
2020-08-07 20:35:05 +02:00
Andreas Kling
498845ea2f LibWeb: Handle CSS "ex" lengths (relative to font x-height)
These are pretty rare, but they do come up in some places and it's not
hard to support. The Gfx::Font information is approximate (and bad)
but we can fix that separately.
2020-08-07 20:30:59 +02:00
Andreas Kling
0bbced444b LibGfx: Add dummy Font::x_height() getter
Right now we just guess that the x-height is glyph_height/2, which is
obviously not accurate. We currently don't store the x-height in fonts,
so that's something we'll need to fix.
2020-08-07 20:29:32 +02:00
Andreas Kling
fae9c9f81f UserspaceEmulator: Add the dup2 syscall 2020-08-07 18:46:56 +02:00
Andreas Kling
5dce5fa7c2 UserspaceEmulator: Add the chdir syscall 2020-08-07 18:44:51 +02:00
Andreas Kling
ee5e8081da UserspaceEmulator: Pass full path to new UE instance in virt$execve()
Don't just pass argv[0] to the new UE, pass the full program path.
2020-08-07 17:28:00 +02:00
Muhammad Zahalqa
91d259ef1c
LibThread: Remove redundant --m_level in Lock::unlock() (#3040) 2020-08-07 17:24:49 +02:00
Andreas Kling
5a5b687014 UserspaceEmulator: Add the getpgid() and waitid() syscalls
With this, you can now kinda sorta run the shell in UserspaceEmulator!
2020-08-07 16:51:08 +02:00
Andreas Kling
93b1e54237 UserspaceEmulator: Add the setpgid syscall 2020-08-07 16:34:50 +02:00
Andreas Kling
2b3b83801b UserspaceEmulator: Make the "unimplemented syscall" output look nicer 2020-08-07 16:34:50 +02:00
Brian Gianforcaro
35c745ca54 Kernel: Use Userspace<T> for the realpath syscall 2020-08-07 16:18:36 +02:00
Brian Gianforcaro
30b2c0dc85 Kernel: Use Userspace<T> for the getsockopt syscall and Socket interface
The way getsockopt is implemented for socket types requires us to push
down Userspace<T> using into those interfaces. This change does so, and
utilizes proper copy implementations instead of the kind of haphazard
pointer dereferencing that was occurring there before.
2020-08-07 16:18:36 +02:00
Brian Gianforcaro
6920d5f423 Kernel: Use Userspace<T> for the setsockopt syscall 2020-08-07 16:18:36 +02:00
Brian Gianforcaro
9f685ac30a AK: Add static_ptr_cast support for the Userspace<T> pointer type
When using Userspace<T> there are certain syscalls where being able
to cast between types is needed. You should be able to easily cast
away the Userspace<T> wrapper, but it's perfectly safe to be able to
cast the internal type that is being wrapped.
2020-08-07 16:18:36 +02:00
Brian Gianforcaro
8fa46bcb7d Kernel: Use Userspace<T> for the getsockname syscall 2020-08-07 16:18:36 +02:00
Brian Gianforcaro
dc75ea9fc2 Kernel: Use Userspace<T> for the getpeername syscall 2020-08-07 16:18:36 +02:00
Brian Gianforcaro
0db669a9d2 Kernel: Use Userspace<T> for the chown syscall 2020-08-07 16:18:36 +02:00
Brian Gianforcaro
7e7ee2ec94 Kernel: Use Userspace<T> for the mount syscall 2020-08-07 16:18:36 +02:00
asynts
3fb62e8c63 AK: Remove unnecessary clang-format off comments. 2020-08-07 15:57:51 +02:00
Andreas Kling
5ba2022b8e UserspaceEmulator: Result is initialized after OR with all-1 immediate
When compiling with "-Os", GCC produces the following pattern for
atomic decrement (which is used by our RefCounted template):

    or eax, -1
    lock xadd [destination], eax

Since or-ing with -1 will always produce the same output (-1), we can
mark the result of these operations as initialized. This stops us from
complaining about false positives when running the shell in UE. :^)
2020-08-07 15:41:53 +02:00
Andreas Kling
3b3d158649 Shell: Make Command::redirections a NonnullRefPtrVector 2020-08-07 09:42:12 +02:00
Andreas Kling
c29681cb03 Shell: Make VariableDeclarations::Variable store NonnullRefPtrs 2020-08-07 09:41:04 +02:00
Andreas Kling
e9c602bc83 Shell: Make resolve_without_cast() return NonnullRefPtr<Value> 2020-08-07 09:36:15 +02:00
Andreas Kling
420e809fee Shell: Store ListValue's values in a NonnullRefPtrVector<Value>
A ListValue never stores null Values, so it makes sense to restrict it.
This also propagates use of NonnullRefPtr to the create() helpers.
There's a small bit of awkwardness around the use of initializer_list,
since we cannot directly construct a NonnullRefPtrVector from one.
2020-08-07 09:33:05 +02:00
Andreas Kling
08e5371f44 Shell: Add some obvious move() calls in AST constructors 2020-08-07 09:19:59 +02:00
Andreas Kling
379e6f5817 LibWeb: Remove unused LayoutPosition comparison operators 2020-08-07 09:17:34 +02:00
Valtteri Koskivuori
b0ab6b9e3f KeyboardSettings: Preselect the current keymap in the dropdown menu.
This is the little omission that I originally set out to fix, and
sure enough, I got to delve into Kernel land and back to implement
it. Lots of fun!
2020-08-07 09:11:04 +02:00
Brian Gianforcaro
bcb4cb4543 AudioServer: Lock the process veil after startup
We can't do any file syscalls anyway because of the reduction of pledges,
so we might as well lock the veil anyway.
2020-08-07 09:10:14 +02:00
Nico Weber
f008e83eae LibLine: Add Ctrl-k shortcut
Only does the 'delete to end of line' bit for now.
No yank ring support yet.
2020-08-07 09:07:30 +02:00
Valtteri Koskivuori
c1f633e1ee Documentation: Add a mention of the recent requirement for a newer
host compiler. On macOS this might have to be specified explicitly.
2020-08-07 09:07:10 +02:00
Nico Weber
530fb7eb82 LibLine: Add Alt-t shortcut for transposing words 2020-08-07 09:04:28 +02:00
Nico Weber
c1fb5263a5 LibLine: Add binding for Alt-backspace
It backward-deletes a word like Ctrl-W, but it has a slightly
different definition of what a word is. For example, with the
caret behind `gcc -fsanitize=address`, Ctrl-W would delete
'-fsanitize=address' but Alt-backspace would only delete 'address'.
2020-08-06 21:06:14 +02:00
Nico Weber
2051d690d5 LibLine: Fix "word" handling for alt-d/u/l/c/f/b and ctrl-left/right
All these shortcuts treat consecutive alnums as a word, not consecutive
non-spaces.

For example, `alias KILL='kill -9'` can now be written by typing it
out lowercase, then hitting ctrl-a alt-f alt-u.

Ctrl-W still treats a word as a sequence of non-spaces. Alt-backspace
in a future patch will add the ability to backward-delete a word
that's a sequence of alnums.
2020-08-06 20:55:27 +02:00
Linus Groh
d9de0a5007 Userland: Use Core::ArgsParser for 'aplay' 2020-08-06 20:41:13 +02:00
Linus Groh
8f33a44b6c Userland: Use Core::ArgsParser for 'avol' 2020-08-06 20:41:13 +02:00
Linus Groh
9b07defb36 Userland: Use Core::ArgsParser for 'basename' 2020-08-06 20:41:13 +02:00
Linus Groh
14db94f44b Userland: Use Core::ArgsParser for 'chgrp' 2020-08-06 20:41:13 +02:00
Linus Groh
c8d690d840 Userland: Use Core::ArgsParser for 'disasm' 2020-08-06 20:41:13 +02:00
Linus Groh
31a4a2cc2a Userland: Use Core::ArgsParser for 'hostname' 2020-08-06 20:41:13 +02:00
Linus Groh
718a45ef71 Userland: Handle invalid JSON in 'jp' 2020-08-06 20:41:13 +02:00
Linus Groh
f4f3ab0ad9 Userland: Use Core::ArgsParser for 'jp' 2020-08-06 20:41:13 +02:00
Linus Groh
ab1f3551cc Userland: Use Core::ArgsParser for 'md' 2020-08-06 20:41:13 +02:00
Linus Groh
f6369a66b1 Userland: Use Core::ArgsParser for 'modload' 2020-08-06 20:41:13 +02:00
Linus Groh
3cc5ed642e Userland: Use Core::ArgsParser for 'modunload' 2020-08-06 20:41:13 +02:00
Linus Groh
ca799fe4ab Userland: Use Core::ArgsParser for 'ping' 2020-08-06 20:41:13 +02:00
Linus Groh
59942edcc0 Userland: Use Core::ArgsParser for 'pro' 2020-08-06 20:41:13 +02:00