Commit graph

39687 commits

Author SHA1 Message Date
Tim Schumacher
e79f0e2ee9 Kernel+LibC: Don't hardcode the maximum signal number everywhere 2022-07-22 10:07:15 -07:00
Tim Schumacher
a39a341e26 Ports: Update the CMake platform module from upstream
While we're at it, remove the `/bin/sh` patch that is no longer needed,
as we now build the port fully on the host.
2022-07-22 17:33:28 +01:00
Obinna Ikeh
9956d3d1e1 LibJS: Add tests for %TypedArray%.prototype.with 2022-07-22 17:17:15 +01:00
Obinna Ikeh
4a201e8854 LibJS: Add %TypedArray%.prototype.with 2022-07-22 17:17:15 +01:00
Luke Wilde
1e829c4ea8 LibJS: Check PlainMonthDay is in the ISO date time limits in creation
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/374305c
2022-07-22 17:10:03 +01:00
Luke Wilde
61847b3cef LibJS: Disallow negative day lengths in ZonedDateTime.protoype.round
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6f04074
2022-07-22 17:10:03 +01:00
Kenneth Myhra
114120852d LibWeb/IDL: Handle passing ArrayBuffer to an IDL union type
This fixes a bug where an ArrayBuffer passed to the Blob constructor
would just be stringified to: "[object ArrayBuffer]".
2022-07-22 10:18:53 +01:00
Timothy Flynn
b8d4f8debf LibJS: Selectively display DateTimeFormat day periods as noon 2022-07-21 20:36:03 +01:00
Timothy Flynn
32c07bc6c3 LibUnicode: Generate per-locale data for the "noon" fixed day period
Note that not all locales have this day period.
2022-07-21 20:36:03 +01:00
Timothy Flynn
16b673eaa9 LibUnicode: Check whether a calendar symbol for a locale actually exists
In the generated unique string list, index 0 is the empty string, and is
used to indicate a value doesn't exist in the CLDR. Check for this
before returning an empty calendar symbol.

For example, an upcoming commit will add the fixed day period "noon",
which not all locales support.
2022-07-21 20:36:03 +01:00
Timothy Flynn
0f26ab89ae LibJS+LibUnicode: Handle flexible day periods on both sides of midnight
Commit ec7d535 only partially handled the case of flexible day periods
rolling over midnight, in that it only worked for hours after midnight.
For example, the en locale defines a day period range of [21:00, 06:00).
The previous method of adding 24 hours to the given hour would change
e.g. 23:00 to 47:00, which isn't valid.
2022-07-21 20:36:03 +01:00
Samuel Bowman
fadd69263a PartitionEditor: Add size column 2022-07-21 20:13:44 +01:00
Samuel Bowman
ba9f60785b PartitionEditor: Add total blocks column 2022-07-21 20:13:44 +01:00
Samuel Bowman
2f8c20816e LibPartition: Fix end block off by one error
Previously, end block was inconsistent. GUIDPartitionTable treated
end block as an inclusive bound, while MBRPartitionTable and
EBRPartitionTable treated end block as an exclusive bound.
Now all three treat end block as an inclusive upper bound.
2022-07-21 20:13:44 +01:00
Samuel Bowman
fb4221ad52 PartitionEditor: Abort and show a dialog if not running as root 2022-07-21 20:13:44 +01:00
Samuel Bowman
7a8953a833 PartitionEditor: Add the beginnings of a partition editor :^)
This adds a new application PartitionEditor which will eventually be
used to create and edit partition tables. Since LibPartition does not
know how to write partition tables yet, it is currently read-only.

Devices are discovered by scanning /dev for block device files.
Since block devices are chmod 600, PartitionEditor be must run as root.

By default Serenity uses the entire disk for the ext2 filesystem
without a partition table. This isn't useful for testing as the
partition list for the default disk will be empty. To test properly,
I created a few disk images using various partitioning schemes
(MBR, EBR, and GPT) and attached them using the following command:

export SERENITY_EXTRA_QEMU_ARGS="
  -drive file=/path/to/mbr.img,format=raw,index=1,media=disk
  -drive file=/path/to/ebr.img,format=raw,index=2,media=disk
  -drive file=/path/to/gpt.img,format=raw,index=3,media=disk"
2022-07-21 20:13:44 +01:00
Samuel Bowman
7b8088c78d LibCore: Add File::is_{block,char}_device() helpers
The existing File::is_device() helpers don't distinguish between
block and char devices. This commit adds File::is_block_device() and
File::is_char_device() helpers which are more specific.
2022-07-21 20:13:44 +01:00
Samuel Bowman
380ce43afc LibPartition: Make GUIDPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
11b4d51fc9 LibPartition: Make EBRPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
7e45c3b687 LibPartition: Make MBRPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
6a1c85aa61 LibPartition: Make PartitionTable kernel/userland agnostic
Previously, PartitionTable was constructed using a Kernel::StorageDevice
making it only usable in the kernel. This commit adds a new constructor
that takes a Core::File instead, making it usable in userland as well.

This also adds the m_block_size field which stores the block size of the
underlying device obtained by calling StorageDevice::block_size() in the
kernel or by using the STORAGE_DEVICE_GET_BLOCK_SIZE ioctl in userland.
This avoids the need for an #ifdef every time block size is needed.
2022-07-21 20:13:44 +01:00
Samuel Bowman
f6ab636d31 Kernel: Move DiskPartition up into Kernel/Storage
Everything in Kernel/Storage/Partition but DiskPartition has been moved
into LibPartiton. This makes the Partition directory unnecessary so
DiskPartition is moved up into Kernel/Storage.
2022-07-21 20:13:44 +01:00
Samuel Bowman
25de9de7dc Kernel+LibPartition: Move GUIDPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
9053d86b82 Kernel+LibPartition: Move EBRPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
1a6ef03e4a Kernel+LibPartition: Move MBRPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
940dde9947 Kernel+LibPartition: Move PartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
be1c5c6b9f Kernel+LibPartition: Move DiskPartitionMetadata into LibPartition
This commit creates a new library LibPartition which will contain
partition related code sharable between Kernel and Userland and
includes DiskPartitionMetadata as the first shared class.
2022-07-21 20:13:44 +01:00
Sam Atkins
2786147774 Documentation: Add a table of contents for Documentation 2022-07-21 17:35:36 +01:00
Sam Atkins
9ddca98bb0 Documentation: Rename UsingQtCreator.md
This name was the odd one out among the IDE/Editor guides.
2022-07-21 17:35:36 +01:00
Timur Sultanov
9906f41e01 Keymap+WindowServer: Add context menu to keymap applet
Adding a context menu which lists configured keymaps and allows
setting the active keymap
2022-07-21 16:40:47 +02:00
Itamar
db11cfa2c5 Utilities+LibELF: Temporary promises for dynamic linker in "pledge"
This adds a "temporary promises for the dynamic-linker" flag ('-d')
to the "pledge" utility.

Example usage:
pledge -d -p "stdio rpath" id

Without the '-d' flag, id would crash because the dynamic linker
requires 'prot_exec'.

When this flag is used and the program to be run is dynamically linked,
"pledge" adds promises that are required by the dynamic linker
to the promise set provided by the user.

The dynamic linker will later "give up" the pledge promises it no
longer requires.
2022-07-21 16:40:11 +02:00
Itamar
91a03bc6ae LibCore: Add function for searching a file in $PATH
This extracts the logic of searching for a file in $PATH from
System::exec to a separate function.
2022-07-21 16:40:11 +02:00
Idan Horowitz
01f0ae20b6 LibPthread: Implement named semaphores
Note that as part of this commit semaphore.cpp is excluded from the
DynamicLoader, as the dynamic loader does not build with pthread.cpp
which semaphore.cpp uses.
2022-07-21 16:39:22 +02:00
Idan Horowitz
23f3857cdd SystemServer: Create /tmp/semaphore on startup
This directory will store all LibPthread named semaphores
2022-07-21 16:39:22 +02:00
Idan Horowitz
35789f56a5 LibPthread: Support process-shared semaphores 2022-07-21 16:39:22 +02:00
Idan Horowitz
3f838768d9 LibPthread: Add magic bytes to the start of sem_t structures
This helps ensure random pointers are not passed in as semaphores, but
more importantly once named semaphores are implemented, this will
ensure that random files are not used as semaphores.
2022-07-21 16:39:22 +02:00
Idan Horowitz
e80c0bde70 LibC: Support blocking flock() 2022-07-21 16:39:22 +02:00
Idan Horowitz
3a80b25ed6 Kernel: Support F_SETLKW in fcntl 2022-07-21 16:39:22 +02:00
Idan Horowitz
9db10887a1 Kernel: Clean up sys$futex and add support for cross-process futexes 2022-07-21 16:39:22 +02:00
Idan Horowitz
55c7496200 Kernel: Propagate OOM conditions out of sys$futex 2022-07-21 16:39:22 +02:00
Idan Horowitz
364f6a9bf0 Kernel: Remove the Socket::{protocol,}connect ShouldBlock argument
This argument is always set to description.is_blocking(), but
description is also given as a separate argument, so there's no point
to piping it through separately.
2022-07-21 16:39:22 +02:00
Andrew Kaster
2aaaee6744 CI+Lagom: Add Lagom Android CI for arm64-v8a on NDK 24 with API level 30
This will let us validate that we aren't breaking any library compile
steps for arm64.
2022-07-21 16:37:15 +02:00
Andrew Kaster
f4e30d6b17 LibC: Only select Elf32_* in ElfW() macro defintion on 32-bit platforms 2022-07-21 16:37:15 +02:00
Tim Schumacher
d270c57022 du: Implement the 1k block size short option 2022-07-21 16:37:04 +02:00
Tim Schumacher
220a50111a du: Invert apparent-size behaviour
The apparent size is what `stat` says what we use. The non-apparent size
is the blocks that we actually use on-disk.
2022-07-21 16:37:04 +02:00
Tim Schumacher
d2d6e7835e du: Implement custom block sizes 2022-07-21 16:37:04 +02:00
Tim Schumacher
c938321731 du: Replace home-grown block-based size calculation with ceil_div 2022-07-21 16:37:04 +02:00
Tim Schumacher
bb5db7fba6 LibCore: Add support for long integral types to ArgsParser 2022-07-21 16:37:04 +02:00
Tim Schumacher
0f66963a56 LibCore: Implement integral ArgsParser options through a template
This keeps us from having to duplicate code for each data type we add.
2022-07-21 16:37:04 +02:00
Sam Atkins
094ba6525f LibWeb: Allow calc() inside CSS transform functions :^)
As noted, we should probably handle calc() parsing as part of parsing
other values. eg, any `<length>` can be a `calc()` that returns a
length, but we currently have to manually handle that everywhere that
doesn't use the `Parser::parse_css_value(ComponentValue)` method.
2022-07-21 16:36:08 +02:00