Commit graph

11795 commits

Author SHA1 Message Date
Brian Gianforcaro
5a984b811c Build: Re-enable -Werror when building with GCC
It looks like PR #2986 mistakenly removed this from both the
Clang and GCC CXX_FLAGS, when the intention seems to have been
to only disable it for Clang.
2020-08-05 12:07:20 +02:00
Luke
f71b112530 Documentation: Add an installation guide for VirtualBox
Now that Serenity can run on VirtualBox, it's time for the documentation.
2020-08-05 10:52:48 +02:00
Brian Gianforcaro
ea3ee4f3f3 Kernel: Decorate KResultOr with [[nodiscard]] to catch misbehaving callers
The [[nodiscard]] decorator enables us to have the compile emit a
warning anytime the decorated type or function's return value isn't
observed. It's very useful for catching error checking bugs in systems
which use C style error handling.
2020-08-05 10:26:29 +02:00
Brian Gianforcaro
e8c9b5e870 Kernel: Make Inode::directory_entry_count errors observable.
Certain implementations of Inode::directory_entry_count were calling
functions which returned errors, but had no way of surfacing them.
Switch the return type to KResultOr<size_t> and start observing these
error paths.
2020-08-05 10:26:29 +02:00
Brian Gianforcaro
7490ea9449 Kernel + LibPthread: Use Userspace<T> in the create_thread syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
337e8f98cd Kernel: Use Userspace<T> for the rename syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
c1541f4a61 Kernel: Use Userspace<T> for the mknod syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
d949b2a367 Kernel: Use Userspace<T> for the set_mmap_name syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
7449921f53 Kernel: Use Userspace<T> for the readlink syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
901dae0227 Kernel: Use Userspace<T> for the mmap syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
74d3b202f1 Kernel: Use Userspace<T> for the waitid syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
84035e1035 Kernel: Use Userspace<T> for the clock_nanosleep syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
baa070afb8 Kernel: Use Userspace<T> for the gettimeofday syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
1eeaed31c2 Kernel: Use Userspace<T> for the open syscall 2020-08-05 09:36:53 +02:00
Brian Gianforcaro
f3eb7db422 Kernel: Switch IPv4Socket receive queue to SinglyLinkedListWithCount<T>
Avoid walking the packet queue, instead use a linked list with a count.
2020-08-05 09:34:22 +02:00
Brian Gianforcaro
efb0805d8e AK: Add SinglyLinkedListWithCount<T>, a singulary linked list with count
There are use cases where a linked list is useful but it's also worth
the overhead to maintain a count so you can quickly answer queries of
the size of the list.
2020-08-05 09:34:22 +02:00
Andreas Kling
83e32788d5 Kernel: Send SIGTTIN and SIGTTOU signals on background TTY read/write
A process that is not in the foreground process group of a TTY should
not be allowed to read/write that TTY. Instead, we now send either a
SIGTTIN (on read) or SIGTTOU (on write) signal to the process, and fail
the I/O syscall with EINTR.

Fixes #205.
2020-08-04 21:25:44 +02:00
AnotherTest
771751258e Shell: Give the TTY to the foreground process
This fixes the bug with the shell not waiting for any foreground process
that attempts to read from the terminal in the Lagom build.
2020-08-04 21:22:44 +02:00
Andreas Kling
984683cf34 Revert "LibM: Always include <math.h> instead of <LibM/math.h>"
This reverts commit dc12cbca41.

Sadly this broke the build due to some confusion about <new>.
Reverting until this can be solved fully.
2020-08-04 21:17:43 +02:00
Andreas Kling
000ef0ec3d Revert "AK: Let the compiler provide the default new and delete operators"
This reverts commit 45b05e9734.

I forgot about the Toolchain build again. :^(
2020-08-04 21:16:07 +02:00
Andreas Kling
90dcab381a SystemMonitor: Replace custom ProcessTableView with just GUI::TableView
This class was added in the very early days of LibGUI, when I wasn't
quite sure if subclassing table views made sense or not.
2020-08-04 21:03:53 +02:00
Andreas Kling
dc12cbca41 LibM: Always include <math.h> instead of <LibM/math.h>
This makes Lagom pick up the host math.h, which is what we want.
2020-08-04 19:06:27 +02:00
Andreas Kling
45b05e9734 AK: Let the compiler provide the default new and delete operators
...except in kernelspace.
2020-08-04 19:05:48 +02:00
Andreas Kling
3cb8ae873c Shell: Use NonnullRefPtr to simplify some things in the parser/AST 2020-08-04 18:17:16 +02:00
Andreas Kling
7a3ab6c517 Kernel: Make File::write() and File::read() return KResultOr<size_t>
Instead of returning a ssize_t where negative values mean error,
we now return KResultOr<size_t> and use the error state to report
errors exclusively.
2020-08-04 18:17:16 +02:00
Andreas Kling
58feebeed2 Kernel+LibC: Tidy up sys$ttyname() and sys$ptsname()
- Remove goofy _r suffix from syscall names.
- Don't take a signed buffer size.
- Use Userspace<T>.
- Make TTY::tty_name() return a String instead of a StringView.
2020-08-04 18:17:16 +02:00
Andreas Kling
cb1fcd3eaf LaunchServer: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
8cf818e7c7 ResourceGraph.MenuApplet: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
9e81b93ab9 Clock.MenuApplet: Disown child process after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
6e1cb2bae8 SystemMenu: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
cf624550e5 Terminal: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
256ad7b122 SystemMonitor: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
27d3971ba6 QuickShow: Disown child process after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
46ab006c58 FileManager: Disown spawned processes 2020-08-04 18:17:16 +02:00
Andreas Kling
edefcc7f3a Taskbar: Disown quick-launched programs 2020-08-04 18:17:16 +02:00
Andreas Kling
7219f069a5 SystemMenu: Disown spawned programs 2020-08-04 18:17:16 +02:00
Andreas Kling
7de831efc6 Kernel+LibC: Add sys$disown() for disowning child processes
This syscall allows a parent process to disown a child process, setting
its parent PID to 0.

Unparented processes are automatically reaped by the kernel upon exit,
and no sys$waitid() is required. This will make it much nicer to do
spawn-and-forget which is common in the GUI environment.
2020-08-04 18:17:16 +02:00
Andreas Kling
83a4fbf548 Kernel: Tidy up the syscalls list by reorganizing the enumerator macro 2020-08-04 18:17:16 +02:00
Nico Weber
a619943001 Build: Make things build with clang without needing local changes
Useful for sanitizer fuzzer builds.

clang doesn't have a -fconcepts switch (I'm guessing it just enables
concepts automatically with -std=c++2a, but I haven't checked),
and at least the version on my system doesn't understand
-Wno-deprecated-move, so pass these two flags only to gcc.
In return, disable -Woverloaded-virtual which fires in many places.

The preceding commits fixed the handful of -Wunused-private-field
warnings that clang emitted.
2020-08-04 17:42:08 +02:00
Nico Weber
5f109c1885 LibGemini: Remove unused private field m_queued_finish 2020-08-04 17:42:08 +02:00
Nico Weber
5892e5a300 LibX86: Remove unused private fields m_segment, m_handler 2020-08-04 17:42:08 +02:00
Nico Weber
d0ad82f5c0 LibLine: Removed unused private field m_prompt_metrics 2020-08-04 17:42:08 +02:00
Nico Weber
d8b6314018 Build: Support make's and ninja's restat optimization
After running a build command, make by default stat()s the command's
output, and if it wasn't touched, then it cancels all build steps
that were scheduled only because this command was expected to change
the output.

Ninja has the same feature, but it's opt-in behind the per-command
"restat = 1" setting. However, CMake enables it by default for all
custom commands.

Use Meta/write-only-on-difference.sh to write the output to a temporary
file, and then copy the temporary file only to the final location if the
contents of the output have changed since last time.
write-only-on-difference.sh automatically creates the output's parent
directory, so stop doing that in CMake.

Reduces the number of build steps that run after touching a file
in LibCore from 522 to 312.

Since we now no longer trigger the CMake special case "If COMMAND
specifies an executable target name (created by the add_executable()
command), it will automatically be replaced by the location of the
executable created at build time", we now need to use qualified paths to
the generators.

Somewhat related to #2877.
2020-08-04 15:58:08 +02:00
AnotherTest
1d08cab9ab Shell: Correct FdRedirection inheriting from two RefCounted bases
Also add missing calls to `adopt()`.
2020-08-04 13:40:58 +02:00
AnotherTest
12af65c1c9 Shell: Add support for ARGV (and $*, $#)
This patchset also adds the 'shift' builtin, as well as the usual tests.
closes #2948.
2020-08-04 13:40:58 +02:00
Melissa Goad
192b2383ac LibJS: The Math.ceil() of a number between -1 and 0 should be -0,
according to the spec.
2020-08-04 11:31:11 +02:00
Ben Wiederhake
aaa13e5739 Meta: Provide a way to only update a file if the output changes
This is only useful for build commands that update their destination in all cases
and thus sometimes confuse cmake into rebuilding everything needlessly.
2020-08-04 11:27:14 +02:00
stelar7
98e18d7339 LibCompress: Add LibCompress
For now this only contains DEFLATE, and a very simple Zlib
Eventually GZip, etc. can go here as well.
2020-08-04 11:27:07 +02:00
Luke
567845c480 LibWeb: Make sure that head and body always get the HTML element
Now that document element returns a generic DOM element, we need to
make sure head and body get a html element. 

The spec just says to check if the document element is a html element,
so let's do that.
2020-08-04 11:05:14 +02:00
Mathieu PATUREL
0622b60fbd Shell: factor out updating the path cache into a function. 2020-08-04 10:51:16 +02:00