Commit graph

33395 commits

Author SHA1 Message Date
Timothy Flynn
9605be19bb LibCore: Support DateTime string formatting of the form %:z
This formats the time zone offset as "+hh:mm" or "-hh:mm". This doesn't
appear to be strictly POSIX, but it is how Linux implements this format.
2022-01-25 23:21:30 +00:00
Timothy Flynn
d9ee218701 LibCore: Support DateTime string formatting of the form %z
This formats the time zone offset as "+hhmm" or "-hhmm".
2022-01-25 23:21:30 +00:00
Idan Horowitz
6e38076b48 AK: Use x86 specific fast path in fast_u32{fill, copy} on x86_64 2022-01-26 01:16:43 +02:00
Timothy Flynn
59ca435172 LibJS: Use new construct AO overload where easily applicable 2022-01-25 22:09:13 +00:00
Timothy Flynn
67e02f6ca6 LibJS: Add templated overloads for the construct AO to create its MVL
Instead of requiring callers to construct a MarkedValueList, add a
variadic templated overload to construct the MVL on the caller's behalf.
2022-01-25 22:09:13 +00:00
Timothy Flynn
4661a0f228 LibJS: Use forwarding references for call's variadic template arguments 2022-01-25 22:09:13 +00:00
Timothy Flynn
5c4b1e3d23 LibJS: Remove erroneous variadic template from some call overloads
These function do not use the Args variadic template.
2022-01-25 22:09:13 +00:00
Ali Mohammad Pur
5fac41f733 LibRegex: Implement ECMA262 multiline matching without splitting lines
As ECMA262 regex allows `[^]` and literal newlines to match newlines in
the input string, we shouldn't split the input string into lines, rather
simply make boundaries and catchall patterns capable of checking for
these conditions specifically.
2022-01-26 00:53:09 +03:30
Ali Mohammad Pur
98183ef572 Meta: Correct the PNP ID download condition
`PNP_IDS_PATH` does not exist, set this to `PNP_IDS_EXPORT_PATH` to
avoid redownloading the database every reconfigure.
2022-01-26 00:53:09 +03:30
Ali Mohammad Pur
aa20210119 LibRegex: Don't return empty vectors from RegexStringView::lines()
Instead, return a vector of one empty string.
2022-01-26 00:53:09 +03:30
Idan Horowitz
c9d026d7bc Kernel: Perform DeviceManagement initialization after MM is initialized
There's no need to perform it this early, and until the MemoryManager
is initialized we have very limited kmalloc capacity, so let's try and
keep anything that's not required to be there out of there.
2022-01-25 22:41:26 +02:00
Idan Horowitz
fa0a052fc6 Kernel: Use PARTUUID: instead of PARTUUID= as the partition uuid prefix
This makes the functionality work again, as we no longer allow any
equal signs inside boot parameter values.
2022-01-25 22:41:17 +02:00
Idan Horowitz
971ab3b919 Kernel: Use u64 instead of size_t in the STORAGE_DEVICE_GET_SIZE ioctl
This ensures the device size doesn't get truncated on i686.
2022-01-25 22:41:17 +02:00
Idan Horowitz
d1ed554dc8 Kernel: Use u64 instead of u32 and u16 in StorageDevice::{read, write}
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz
b9cce82cf3 Kernel: Stop using unsigned when adjusting offsets in DiskPartition
These can only contain 32 bit values, and so will truncate very large
offsets.
2022-01-25 22:41:17 +02:00
Idan Horowitz
2065a73727 Kernel: Use u64 instead of size_t for BlockBasedFileSystem::read_block
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz
0b2e93cf43 Kernel: Use u64 instead of size_t for BlockBasedFileSystem::write_block
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz
664ca58746 Kernel: Use u64 instead of size_t for File::can_write offset
This ensures offsets will not be truncated on large files on i686.
2022-01-25 22:41:17 +02:00
Idan Horowitz
9ce537d703 Kernel: Use u64 instead of size_t for File::can_read offset
This ensures offsets will not be truncated on large files on i686.
2022-01-25 22:41:17 +02:00
Timothy Flynn
0c630d5687 LibJS: Implement Intl.RelativeTimeFormat.prototype.resolvedOptions 2022-01-25 19:02:59 +00:00
Timothy Flynn
b50880f28c LibJS: Fix errors in Intl.DateTimeFormat.prototype.resolvedOptions tests
Noticed these while implementing this prototype for RelativeTimeFormat.
2022-01-25 19:02:59 +00:00
Timothy Flynn
cf166c1d93 LibJS: Implement Intl.RelativeTimeFormat.supportedLocalesOf 2022-01-25 19:02:59 +00:00
Timothy Flynn
47e9e7c2d0 js: Implement pretty-printing of Intl.RelativeTimeFormat 2022-01-25 19:02:59 +00:00
Timothy Flynn
a2e31ed736 LibJS: Implement the Intl.RelativeTimeFormat constructor 2022-01-25 19:02:59 +00:00
Timothy Flynn
79fdec85de LibJS: Implement a nearly empty Intl.RelativeTimeFormat object
This adds plumbing for the Intl.RelativeTimeFormat object, constructor,
and prototype.
2022-01-25 19:02:59 +00:00
Timothy Flynn
0865f71d37 LibJS: Convert Intl.NumberFormat to use Unicode::Style 2022-01-25 19:02:59 +00:00
Timothy Flynn
25e67f63a2 LibJS: Convert Intl.DisplayNames to use Unicode::Style 2022-01-25 19:02:59 +00:00
Timothy Flynn
bced4e9324 LibJS+LibUnicode: Convert Intl.ListFormat to use Unicode::Style
Remove ListFormat's own definition of the Style enum, which was further
duplicated by a generated ListPatternStyle enum with the same values.
2022-01-25 19:02:59 +00:00
Timothy Flynn
e261132e8b LibUnicode: Add helper methods to convert a Style to and from a string
This conversion is duplicated a few times in our Intl implementation, so
let's just define these once and be done with it.
2022-01-25 19:02:59 +00:00
Timothy Flynn
7f6edb7976 LibUnicode: Remove the Unicode::Style::Numeric value
It is unused.
2022-01-25 19:02:59 +00:00
Timothy Flynn
a027ccad75 LibTimeZone+Userland: Rename current_time_zone to system_time_zone
This renames the current implementation of current_time_zone to
system_time_zone to more clearly indicate what it is. Then reimplements
current_time_zone to return whatever was set up by tzset, falling back
to UTC if something went awry, for convenience.
2022-01-25 18:39:36 +00:00
Timothy Flynn
ede5c9548e Userland: Invoke tzset in applications that care about time zones
In most applications, we invoke tzset once at startup for now. Most of
these are short lived and don't need to know about time zone changes.

The exception is the ClockWidget in the taskbar. Here, we invoke tzset
each time we update the system time. This way, any time zone changes can
take effect immediately.
2022-01-25 18:39:36 +00:00
Timothy Flynn
010ec36d20 LibC: Ensure most time tests run under UTC
This ensures these tests pass even if the user has changed the system
time zone away from UTC.
2022-01-25 18:39:36 +00:00
Timothy Flynn
024f869f09 LibC: Ensure tzname and related fields are intialized
If a program never invokes tzset, the tzname variable should have system
dependent default values.
2022-01-25 18:39:36 +00:00
Timothy Flynn
cd0e5ccd3f LibC: Revert localtime_r to use time zone information set by tzset
Now that tzset actually detects time zones, parties interested in time
zone offsets should invoke tzset.
2022-01-25 18:39:36 +00:00
Timothy Flynn
11f1f04a4c LibC: Invoke tzset from time functions required to update time zone info
From POSIX:

    the ctime(), localtime(), mktime(), strftime(), and strftime_l()
    functions are required to set timezone information as if by calling
    tzset()

ctime is excluded here because it invokes localtime, so there's no need
to invoke tzset twice.
2022-01-25 18:39:36 +00:00
Timothy Flynn
b1ea585149 LibC: Implement tzset with time zone awareness in accordance with POSIX 2022-01-25 18:39:36 +00:00
Timothy Flynn
6095500263 LibC: Define the POSIX TZNAME_MAX limit
POSIX defines this as the "Maximum number of bytes supported for the
name of a timezone (not of the TZ variable)." It must have a minimum
value of _POSIX_TZNAME_MAX (6). The longest time zone name in the TZDB
is about 40 chars, so 64 is chosen here for a little wiggle room, and
to round up to a power of 2.
2022-01-25 18:39:36 +00:00
Timothy Flynn
1f051a8e25 LibTimeZone: Handle time zones which begin the year in daylight savings 2022-01-25 18:39:36 +00:00
Timothy Flynn
7103012c7d LibTimeZone: Add an API to retrieve both daylight and standard offsets
This API will also include the formatted name of the time zone, with
respect for DST (e.g. EST vs EDT for America/New_York).
2022-01-25 18:39:36 +00:00
Timothy Flynn
fc0c88344b LibTimeZone: Slightly refactor the generated DST rule finding method
This just splits up the method to find the active DST rule for specified
time and time zone. This is to allow re-using the now split-off function
in upcoming commits.
2022-01-25 18:39:36 +00:00
Timothy Flynn
ef0155932b LibTimeZone: Parse and generate time zone abbreviation format strings
For example, today, America/New_York has the format string "E%sT" and
uses US DST rules. Those rules indicate the %s should be replaced by a
"D" in daylight time and "S" in standard time.
2022-01-25 18:39:36 +00:00
Timothy Flynn
40147c48be timezone: Add an option to list all time zones 2022-01-25 18:39:36 +00:00
Pankaj Raghav
4a8a3df975 Kernel: Fix index calculation in NVMeQueue submit_sync_sqe function
There was a bug while calculating the next index in submit_sync_sqe
function. Use the NVMeQueue's class variable m_qdepth instead of the
hardcoded IO_QUEUE_SIZE.
2022-01-25 20:06:19 +02:00
Idan Horowitz
67ce9e28a5 AK: Standardize the behaviour of GenericLexer::consume_until overloads
Before this commit all consume_until overloads aside from the Predicate
one would consume (and ignore) the stop char/string, while the
Predicate overload would not, in order to keep behaviour consistent,
the other overloads no longer consume the stop char/string as well.
2022-01-25 13:41:09 +03:30
Idan Horowitz
d49d2c7ec4 AK: Add a consume_until(StringView) overload to GenericLexer
This allows us to skip a strlen call.
2022-01-25 13:41:09 +03:30
James Puleo
10b25d2a57 AK: Implement HashTable::try_ensure_capacity, as used in HashMap
This was used in `HashMap::try_ensure_capacity`, but was missing from
`HashTable`s implementation. No one had used
`HashMap::try_ensure_capacity` before so it went unnoticed!
2022-01-25 09:17:22 +01:00
Andreas Kling
58b5aede65 CrashReporter: Dispatch backtrace progress callbacks on the main thread
We can't fiddle with GUI widgets off the main thread, so let's use
Core::EventLoop::deferred_invoke() to dispatch the work.

The progress bar doesn't visibly update yet, but at least we're not
crashing anymore.
2022-01-25 09:13:40 +01:00
Andreas Kling
d1cea57246 LibThreading: Invoke BackgroundAction completions on origin event loop
We now capture the origin thread's current event loop when setting up
a BackgroundAction and then invoke the on_complete callback on that same
event loop.
2022-01-25 09:13:40 +01:00
Andreas Kling
3bab93c5e7 LibCore: Make Core::s_main_event_loop actually global
This was accidentally per-TU, as it was declared "static" in the header.
2022-01-25 09:13:40 +01:00