100 Commits
Author SHA1 Message Date
Lucas Chollet 3e6b6a88c5 LibSSH+SSHServer: Provide a properly set environment to children
Before this patch, exec commands were inheriting the environment of the
SSHServer instance while interactive shell spawned with an almost empty
env. Now, both paths start with the same basic environment and also
include modifications requested by the ssh client.

This should improve compatibility in a lot of situations but most
visibly it makes syntax highlighting and autocompletion work in
interactive shells.

The list of default environment variables is heavily inspired by what
OpenSSH is doing. Compared to what it produces on my system, we only
lack XDG_*, SSH_* and DBUS_SESSION_BUS_ADDRESS variables. As noted in
the FIXME the value of PATH also differs.
2026-11-05 09:17:57 +01:00
Lucas Chollet fe92281611 LibCore: Support passing environment variables to Process::spawn 2026-11-05 09:17:57 +01:00
Lucas Chollet 7cba67db00 LibCore: Turn ArgvList into a more general C-string array
This will be soon be used for the environment too. And put it in an
anonymous namespace while at it.
2026-11-05 09:17:57 +01:00
Lucas Chollet e984357e1f LibCore: Move the explicit cast to ArgvList::get
This makes the call site easier to read.
2026-11-05 09:17:57 +01:00
Lucas Chollet 31d7c87c68 LibSSH/SFTP: Allow relative paths in the OPEN command
Now that SSHServer sets us in the user's home directory, there is no
need to block them as they will resolve correctly according to the spec:
"File names starting with a slash are "absolute", and are relative to
 the root of the file system.  Names starting with any other character
 are relative to the user's default directory (home directory)."

Also note that we were only refusing relative paths in the OPEN command,
but STAT was already accepting them (and resolving them incorrectly).
2026-11-04 09:47:43 +01:00
Lucas Chollet cf26f5faa4 SSHServer: Set the current directory to the user's home on login
We were already changing the home directory for interactive shells, but
with this change single commands also get executed from the user's home
and SFTP relative paths will also resolve from the correct directory.
(Relative paths are still not allowed in the SFTP layer, but everything
will fall in place once we remove that restriction.)
2026-11-04 09:47:43 +01:00
Lucas Chollet 280b0b2bd5 SSHServer: Send the actual exit status of commands
We now report the actual value instead of simply returning 0/-1. We're
now using the conventional representation for signal-terminated
processes and return an exit-status of 128 + signal number.
2026-11-04 09:47:43 +01:00
Lucas Chollet 207c2f6c5f SSHServer: Use the user's default shell instead of hardcoding it 2026-11-04 09:47:43 +01:00
Lucas Chollet d85d1a984f LibC: Set the pty size in openpty
This aligns the behavior with both Linux and OpenBSD (and probably all
other implementations of openpty).

This bug was visible in SSHServer, indeed when using an interactive
shell, the start pty size was always the default (80x25) instead of
whatever the client's window is using. It is quite visible with `top`,
which now fills the whole window :^)
2026-11-03 12:10:04 +01:00
Lucas Chollet ceed7af2e2 SSHServer: Add support for the window-change request
With this patch, SSHServer is able to update the pty on the server when
the size of the client's window is updated.

Resizing your terminal emulator's window while being connected to
SSHServer no longer make you disconnect.

While the implementation is functional, it seems to have quite more
latency than with a regular SSH server, so visual artifacts may appear
when aggressively resizing the window.
2026-11-03 12:10:04 +01:00
Lucas Chollet 76175e09ba LibCore: Add wrappers for tc{get,set}winsize
On Serenity, this uses the equivalent LibC function, otherwise it
defaults to the pretty standard ioctl equivalent.

At the time of writing, it seems that only musl, BSDs and Serenity have
the standardized POSIX function.
2026-11-03 12:10:04 +01:00
Lucas Chollet 8e34c970b5 LibC: Implement tc{get,set}winsize functions
We already support the operation with ioctl, these functions are simply
the POSIX-compatible way of doing it. They were added in POSIX 2024.
2026-11-03 12:10:04 +01:00
Lucas Chollet 57d7d52024 LibSSH+SSHServer: Add support for interactive shells
Until now, we could only use SSHServer to remotely run single commands
(e.g. `ssh remote command_to_run`). With this patch, we now support
using ssh in the most usual way: starting a remote interactive shell and
then running commands on the host.
2026-11-03 09:31:27 +01:00
Lucas Chollet f680882469 LibSSH+SSHServer: Put child-managing features in a parent of ExecData
This parent will contain the data used for streaming stdin/stdout, the
pid of the child process and a few basic methods required for
subsystems. This refactoring will allow us to easily introduce another
kind of child-managing subsystem, used for interactive shells.
2026-11-03 09:31:27 +01:00
Lucas Chollet dd293dcef1 LibSSH+SSHServer: Add support for the pty-req channel request
This is a step towards supporting interactive shells with SSHServer.
This request includes the options to create the pty associated with the
shell.

Note that we don't validate or do anything else with the options
themselves. We just store them, and any issues with the values will be
discovered when we actually create the pty during the handling of the
"shell" request.
2026-11-03 09:31:27 +01:00
Lucas Chollet f84f37465e Kernel: Use u64 for block counts in the FileSystem API
We already use 8-bytes types for the statvfs syscall, so this change
allows filesystems that support massive sizes to be able to report them
to userspace without being truncated.
2026-10-30 16:19:42 +01:00
Lucas Chollet 3e9763f13e init: Limit the size of /tmp to 90% of the available RAM 2026-10-30 16:19:42 +01:00
Lucas Chollet d87eb4ab2a Kernel/FileSystem: Use 64-bits types in FileSystemSpecificOption
The rest of the plumbing already used 64-bits types, making
FileSystemSpecificOption silently truncate the arguments.

With this patch, we can now create RAMFS filesystems with a size above
4 GiB.
2026-10-30 16:19:42 +01:00
Lucas Chollet ea9747d3a5 Kernel/FileSystem: Remove unused declaration and stale comment 2026-10-30 16:19:42 +01:00
Lucas Chollet b17001d847 Kernel/FileSystem: Share more code in option parsing functions 2026-10-30 16:19:42 +01:00
Lucas Chollet d3ed66350c Kernel/RAMFS: Add an option to control the maximum filesystem size 2026-10-30 16:19:42 +01:00
Lucas Chollet 5176348184 Kernel/RAMFS: Report filesystem usage
For the moment, this only considers the size of files' content without
counting the inodes' cost. While being imprecise, this should already
give a pretty good estimate of the RAM usage caused by these
filesystems.

The value for LOGICAL_BLOCK_SIZE is quite arbitrary as the filesystem
doesn't have blocks, so it's only used as a unit (counting in KiB
instead of bytes).

For the moment, the default maximum size is set to zero (disabled), so
no limits are enforced, it just reports the number of used blocks.
2026-10-30 16:19:42 +01:00
Lucas Chollet ccdd6504f9 Kernel: Don't traverse the whole tree in find_regions_intersecting
When using the default iterator, the region tree is traversed in
ascending order. This mean that as soon as we find a region that is
above the tested range, we can safely exit the loop.

This was a major bottleneck in test-js, with this patch the runtime goes
from 6.761s to 4.680 (using a best-of-five).
2026-10-29 15:03:29 +01:00
Lucas Chollet 5b2dba5f45 Kernel/VFS: Allow rename to overwrite a symlink
Per POSIX:
If either the old or new argument names a symbolic link, rename() shall
operate on the symbolic link itself, and shall not resolve the last
component of the argument.
2026-10-19 17:29:35 +02:00
Lucas Chollet 125f24fa0f LibCore: Add a truncate wrapper 2026-10-19 17:29:35 +02:00
Lucas Chollet 067456f819 Kernel/VFS: Return an error if the path names a symlink in mkdir
Per POSIX:
If path names a symbolic link, mkdir() shall fail and set errno to
[EEXIST].

The test needs to be done in a subfolder of /tmp, I suppose that it
comes from the custom branch for mounted folders in
`resolve_path_without_veil`. Otherwise, the behavior is quite different
and seems to involve other bugs too.
2026-10-19 17:29:35 +02:00
Lucas Chollet 1ecec15b55 LibCore: Make SignalHandlers' member variables private 2026-10-15 16:14:51 +02:00
Lucas Chollet edc8ac4a70 LibCore: Remove unused method in SignalHandlers 2026-10-15 16:14:51 +02:00
Lucas Chollet 2d14bce905 LibCore: Restore signal handlers at exit
The singleton class has the side effect of not calling the destructor of
the class, so ~SignalHandlers() was never called and the signal handlers
were never restored.

While restoring the signal handlers at exit is useless in most cases,
this patch fixes a hang at exit when running Shell in a configuration
using GCC and LSan. The sanitizers create a child process to be able
to monitor the parent. Then, when this child exits, the SIGCHLD signal
tried to run the handler installed by Shell, this caused ASan to trip
while LSan was running which causes the hang.
2026-10-15 16:14:51 +02:00
Lucas Chollet 01f0686eac Revert "LibCrypto: Reject short encoded messages in EMSA_PKCS1_V1_5::verify"
This reverts commit a99c7d9f9d.
2026-10-15 08:56:45 +02:00
Lucas Chollet 5184c07e01 AK/Math: Rely on lgamma to implement gamma
Note that the current implementation of lgamma doesn't work for negative
values of x. But given that Stirling's approximation is also only
defined for positive values of x, this patch don't change anything in
that regard.
2026-10-14 22:19:04 +02:00
Lucas Chollet 2830bdc9e8 CompareMathAgainstMPFR: Add support for the tgamma function 2026-10-14 22:19:04 +02:00
Lucas Chollet b883cce6a2 AK/Math: Consider the long double == f64 case in tgamma's integer path
This code still looks weird and don't support f128, but should at least
be more correct.
2026-10-14 22:19:04 +02:00
Lucas Chollet 15a07a1073 LibC+AK: Move tgamma definition from LibC to AK
This makes the tgamma function accessible from constexpr contexts and
allows us to test it in CompareAKMathAgainstMPFR.
2026-10-14 22:19:04 +02:00
Lucas Chollet bfa440bbf8 AK: Define FloatExtractor for long double when it's an alias of double
On some platforms, like macOS on ARM, long double is a different type
but has the exact same characteristics as a normal double. When it is
the case, define FloatExtractor<long double> as an alias to
FloatExtractor<double>.
2026-10-14 22:19:04 +02:00
Lucas Chollet 09543f0a67 LibCrypto: Build the library with -fzero-call-used-regs=used
By zeroing registers when returning from crypto functions, we prevent
attackers from accessing sensitive information that could otherwise be
left in these registers.

Note that we currently have no safety regarding the same kind of
leakage but with stack or heap memory.

From some small experiments, the performance cost should be under 5%.
This could probably be optimized by only applying it to the public API.
2026-10-14 15:19:27 +02:00
Lucas Chollet bd4bcd52be Meta: Generate one coverage report per library
This allows us to see the coverage of each library without transitive
usages. As an example, Vector::clone() is never tested directly in
Tests/AK, and it's coverage depends on an external test or library. This
means that its coverage is fragile as the code using it in tests might
be dropped in the future.
2026-10-14 09:14:25 +02:00
Lucas Chollet 7dea0e2eb8 Meta: Move $all_binaries definition closer to its use 2026-10-14 09:14:25 +02:00
Lucas Chollet 1241e4f0a6 Meta+CMake: Enable coverage for test binaries
This will allow everything defined in headers to be instrumented. As an
example, the function `AK::any_of` isn't instantiated inside AK, that
means that no coverage is reported if we don't consider the
instantiation in the test binary itself.
2026-10-14 09:14:25 +02:00
Lucas Chollet 05d7ed4e2c Meta+run-tests: Put coverage results in per-library folders 2026-10-14 09:14:25 +02:00
Lucas Chollet 41ebb4e542 Meta: Report an error if the coverage directory already exists
This avoids contaminations from previous runs.
2026-10-14 09:14:25 +02:00
Lucas Chollet f82570ae70 Meta: Make finding executables in analyze-qemu-coverage.sh way faster
Using `find` to do the heavy lifting makes the execution time go from
44s to 3s on my computer.
2026-10-14 09:14:25 +02:00
Lucas Chollet 23b01b9ea1 CI: Use the self-test-coverage mode for coverage builds 2026-10-14 09:14:25 +02:00
Lucas Chollet d76b073506 Base: Add the self-test-coverage system mode
This will allow us to have custom behavior for coverage builds.
2026-10-14 09:14:25 +02:00
Lucas Chollet 933c0066ca AK/Math: Make lgamma a lot more precise on the (0, 8) range
Max ULP                Mean ULP
Before:              inf    998274894113382.2500
After:        7352987.00                 18.7027

While this is already a lot better, the error is still significant. This
is mainly due to the areas around the roots of lgamma(x) (x=1 and x=2)
where the results are close to zero and thus requires tiny absolute
errors. On (0, 0.7] ∪ [2.3, 8) the maximum error is 20 ULP.

This introduces a lot of polynomials, but I don't think we have another
choice here (CORE-MATH uses even more on the same interval). To find the
subdivisions, I simply searched for x so that a degree 12 polynomial
would have a small error (~1e-18) on [x, 8] and then repeated the
process until the full [0, 8] interval was filled.
2026-10-12 18:39:50 +02:00
Lucas Chollet 47685800ab AK/Math: Make lgamma a lot more precise on [8, 1e7)
This is done by using a polynomial to compensate the mathematical error
term of the stirling approximation.

                 Max ULP                Mean ULP
Before: 6697252309907.00       725249701724.2207
After:              2.00                  0.4674
2026-10-12 18:39:50 +02:00
Lucas Chollet 8b823af638 AK/Math: Add a special path for x >= 1e7 in lgamma 2026-10-12 18:39:50 +02:00
Lucas Chollet 606b5fcaa8 AK/Math: Use a more precise stirling approximation in lgamma
This directly yields to better results for values of x > 2.
2026-10-12 18:39:50 +02:00
Lucas Chollet d0d79c2bcb AK/Math: Make lgamma_r's sign computation more sound
This still doesn't always produce the correct result for negative values
of x, but at least this fixes the reasoning.
2026-10-12 18:39:50 +02:00
Lucas Chollet 101c3c50fa AK/Math: Add a comment that describes how to better implement lgamma
And reshape lgamma to look a bit more like what's described in the
comment.
2026-10-12 18:39:50 +02:00
Lucas Chollet e126a950c3 CompareAKMathAgainstMPFR: Add support for the lgamma function 2026-10-12 18:39:50 +02:00
Lucas Chollet f788e89ffb AK/Math: Introduce a lgamma function and implement lgamma_r on top of it
Non-functional change for lgamma_r users but will allow future user of
lgamma to not pay the (low) price of the sign computation.
2026-10-12 18:39:50 +02:00
Lucas Chollet 5b636c2d1d AK+LibC: Move lgamma_r definition from LibC to AK
This allows us to have a constexpr lgamma_r function and also to test it
with CompareAKMathAgainstMPFR.
2026-10-12 18:39:50 +02:00
Lucas Chollet 268cbe22a6 Kernel: Enable -fzero-call-used-regs=used-gpr on RISC-V Clang
This is now supported by Clang trunk.
2026-10-12 09:21:47 +02:00
Lucas Chollet 955b48fa3a Toolchain+Ports: Update LLVM to trunk
This allows us to get rid of the libcxxabi patch as the function is now
opt-out instead of opt-in.
2026-10-12 09:21:47 +02:00
Lucas Chollet 0a8a147389 Tests/Kernel: Reset SIGCHLD's handler at the end of TestWaitFirstNoHang
With this change, when we're done with our test the SIGCHLD handler is
set back to the default one. This fixes an issue when running the test
under LSan with libsanitizers. LSan works by forking and then using
ptrace on the parent to inspect its address space, when this child exits
it was triggering our handler and caused a crash. Restoring the default
handler solves the issue. For some reason, this only happens with GCC's
implementation of LSan while this works fine with Clang's.
2026-10-06 15:27:13 +02:00
Lucas Chollet 5df6434e8c Kernel/VFS: Don't overwrite files when renaming a directory 2026-10-06 09:11:45 -04:00
Lucas Chollet 1f51afef98 Meta: Make building CompareAKMathAgainstMPFR opt-in
The tool depends on MPFR, which is not listed as a required dependency
on all platforms (e.g. macOS). So let's disable CompareAKMathAgainstMPFR
by default instead of adding a new dependency.

To build the tool, set ENABLE_COMPARE_AK_MATH_AGAINST_MPFR to ON in your
Lagom directory.
2026-10-05 11:09:23 +02:00
Lucas Chollet eda3748a19 CompareAKMathAgainstMPFR: Use all CORE-MATH test cases by default
And provide a flag to sample only N test cases from the list.
2026-10-01 22:09:38 +02:00
Lucas Chollet 4f13bbd630 CompareAKMathAgainstMPFR: Add an option to restrict the testing range
Very useful when working on an approximation that only applies to a
specific range.
2026-10-01 22:09:38 +02:00
Lucas Chollet f66949cd5e CompareAKMathAgainstMPFR: Display the ULP of the worst offender
When displaying the expected and computed result in verbose mode,
printing the ULP of the expected value gives a scale to compare the
values.
2026-10-01 22:09:38 +02:00
Lucas Chollet e8e791951e CompareAKMathAgainstMPFR: Add an option to filter tested functions 2026-10-01 22:09:38 +02:00
Lucas Chollet 30fddf9f18 AK/Math: Improve the precision of cosh and sinh
Taking the square of e^x quickly resulted in overflows with the old
formula. See the PR description for benchmark results.
2026-09-27 22:09:41 +02:00
Lucas Chollet 4a83903b96 CompareMathAgainstMPFR: Add support for cosh, sinh and tanh 2026-09-27 22:09:41 +02:00
Lucas Chollet c9753b4d3f CompareAKMathAgainstMPFR: Set exponent limits globally
In the CORE-MATH codebase, not all mpfr-based math functions set the
exponents limits, some assume it is done before calling them. So let's
set it globally and remove the call to mpfr_set_emin code in exp().
2026-09-27 22:09:41 +02:00
Lucas Chollet b37efc6925 Meta: Add a tool to compare our math functions against a trusted source
This tool runs a bunch of accuracy and performance tests on standard
math functions. The accuracy is measured against the MPFR library, which
provides results precise enough to be correctly rounded to double
precision floating points.

By default, the tool test the math functions from AK but a runtime flag
can be used to instead test the system's libm.

A few test cases are internally generated, but to get more precise
results the tool is capable of reading worst-cases files from the
CORE-MATH project. The location of the repository should be given with
the --core-math PATH option.

Heavily inspired by https://github.com/nico/js-math-bench.
2026-09-26 21:19:20 +02:00
Lucas Chollet cccf3076aa Kernel: Return an error on long component names inside paths
From POSIX:
[ENAMETOOLONG]
    The length of the path argument exceeds {PATH_MAX} or a pathname
    component is longer than {NAME_MAX}.
2026-09-26 18:25:41 +02:00
Lucas Chollet a3b87c3293 LibC: Consider f80's explicit leading 1 in internal_to_integer
While the existing f80 path gave a valid result in the float extractor,
the rounding steps were applied as if it was a normal float.
2026-09-24 20:33:35 +02:00
Lucas Chollet d2a1d0e075 LibC: Make nextafterl return a correct value when given equal arguments
This is done by moving the check to the shared implementation.
2026-09-24 20:33:35 +02:00
Lucas Chollet 2b94b63ebc LibC: Handle edge cases correctly in erf 2026-09-24 20:33:35 +02:00
Lucas Chollet f8a9d61aa7 LibC: Compute erf values in the correct type
It's wasteful to compute everything with long double precision when we
don't need it, so this change will be required down the road when we get
to make erf precise and fast. For the time being, this is more a
cosmetic change to align this implementation with others.
2026-09-24 20:33:35 +02:00
Lucas Chollet 627b81a7e5 LibC: Implement fdim* and remquo* functions 2026-09-24 20:33:35 +02:00
Lucas Chollet 33fc5740a2 LibC: Make ctype functions inlinable and have external linkage
Before this commit, you could either use the inlinable function by
using the macro or have the externally-linked version by first
undefining the macro and then using the function.

This commit makes all the ctype functions both inlinable and have
external linkage at the same time. To pull this trick, we provide
inlinable definitions in ctype.h and use a dedicated C feature that
forces the symbol to be emitted in the TU of ctype.c.

This could also have been achieved by using some #ifdef to hide the
inline definition in ctype.h so a C++ compiler would still emit a normal
symbol for the functions in ctype.cpp.
2026-09-24 11:53:15 +02:00
Lucas Chollet 8a1ff05985 Meta: Support building C files 2026-09-24 11:53:15 +02:00
Lucas Chollet abd41e812d LibC: Don't use reserved names for the arguments in strftime declaration
The `max` argument could collide with the macro. Let's use the name
provided by POSIX instead.
2026-09-23 09:36:07 +02:00
Lucas Chollet 5528cdcfb7 LibC: Don't include assert.h from wctype.h
This is not required or used. Removing the include also fixes a bunch
of libcxx tests.
2026-09-22 23:05:29 +02:00
Lucas Chollet ce1809234d LibC: Use an explicit fixme for unsupported formats in strftime 2026-09-21 20:12:39 -04:00
Lucas Chollet df91038f4a LibC: Support a few other formats in strftime 2026-09-21 20:12:39 -04:00
Lucas Chollet 3fcd7ac87b LibC: Don't consider E and O modifiers in strftime
This only affect the output if the current locale has alternative
representations. Given that on Serenity we only use the POSIX/C locale,
and it doesn't have any alternative representations, these modifiers are
basically useless.

"If the alternative format or specification does not exist for the
current locale [...], the behavior shall be as if the unmodified
conversion specification were used."
2026-09-21 20:12:39 -04:00
Lucas Chollet 9fce834276 LibC: Display the correct week number when using %W in strftime
I'm not 100% sure if my formula always produces the right number, but it
is at least correct for the included test case.
2026-09-21 20:12:39 -04:00
Lucas Chollet 5f600d5529 Tests/LibC: Add basic tests for strftime 2026-09-21 20:12:39 -04:00
Lucas Chollet 5d4da773be LibC: Make MB_CUR_MAX have a value compatible with our supported locales
According to POSIX:
"In the POSIX locale the value of {MB_CUR_MAX} shall be 1."
As we only support "POSIX"-compatible locales, let's make MB_CUR_MAX
equal to 1. Note that if we start to support other locales, this macro
will need to defer to a runtime function.
2026-09-21 20:12:39 -04:00
Lucas Chollet d8e8dfeeec LibC: Define MB_CUR_MAX and MB_LEN_MAX in their specified headers
Both locations are specified by POSIX and these values are only user
facing for the moment, so no need to have them in a private header.
2026-09-21 20:12:39 -04:00
Lucas Chollet c13073686e LibC: Start implementing newlocale and freelocale
This is just enough to let caller create default-compatible locales. It
is required by some of libcxx test cases.
2026-09-21 20:12:39 -04:00
Lucas Chollet 6f12afa77b AK: Add basic support %a formatting
No modifiers are currently supported.
2026-09-20 22:06:41 +02:00
Lucas Chollet 8243759bb2 AK: Apply modifiers when printing nan or inf
Before this patch, we would incorrectly handle the '+' (always_sign),
'-' (left padding) and padding size modifiers.
2026-09-20 22:06:41 +02:00
Lucas Chollet 47ce79685f AK: Extract a print_nan_and_inf function 2026-09-20 22:06:41 +02:00
Lucas Chollet 5a4c0d7bd3 LibC: Make strchr and friends compatible with the C++ standard
The C++ standard defines strchr, strrchr, strpbrk, strstr and memchr
differently than POSIX. To be conformant, we need to provide a different
signature when __cplusplus is defined.

This is the same logic as 73d178af, but applied to string.h.
2026-09-14 09:54:00 +02:00
Lucas Chollet 1c6ee19723 Tests/Kernel: Port pthread-cond-timedwait-example to LibTest
Two functional changes were also applied:
 - We no longer check for errno, as mandated by POSIX,
   pthread_cond_timedwait returns the error directly.
 - I reduced the wait time so the test run in ~2s rather than ~75s.
2026-09-14 09:48:01 +02:00
Lucas Chollet 391cb83487 LibC: Align PTHREAD_COND_INITIALIZER with pthread_cond_init
According to POSIX:
"In cases where default condition variable attributes are appropriate,
the macro PTHREAD_COND_INITIALIZER can be used to initialise condition
variables that are statically allocated. The effect is equivalent to
dynamic initialisation by a call to pthread_cond_init() with parameter
attr specified as NULL, except that no error checks are performed."

AFAICT, the clock choice is left as an implementation detail, but other
systems seem to use CLOCK_REALTIME as the default:

https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_cond_init.c

https://github.com/openbsd/src/blob/7da33d17d09f1f2c0e27643875d90dc64f79173c/lib/libc/thread/rthread_cond.c#L30-L47
2026-09-14 09:47:03 +02:00
Lucas Chollet 10b2e3cca3 LibC: Make the NULL macro available in locale.h
From POSIX:
"The <locale.h> header shall define NULL (as defined in <stddef.h>)"
2026-09-12 08:13:32 +02:00
Lucas Chollet 232e5ff01f LibC: Fix typo scalbnlf => scalblnf 2026-09-11 21:44:14 +02:00
Lucas Chollet 9ced10e5e2 Toolchain: Use download_file.sh to download the GNU toolchain
This allows us to remove some lines in BuildGNU.sh but also to use the
mirror syntax.
2026-09-10 10:01:18 +02:00
Lucas Chollet 03220ee363 Meta+Ports: Move file downloading helpers to Meta
This will allow Toolchain's scripts to use the same logic. Note that we
use a symlink in the Ports directory so Meta/install-ports-tree.sh can
just copy the link's destination to have a working and self-contained
copy.
2026-09-10 10:01:18 +02:00
Lucas CholletandEduardo Casadei 73e32131bc Meta: Copy the content of symlink directories in install-ports-tree.sh
For symlinks targeting directories, `git ls-files` only lists the
symlink file and not the content of the targeted directory, so let
`rsync` go recursive on these.

This allows us to also install patches for binutils, gcc and llvm.

Co-authored-by: Eduardo Casadei <[email protected]>
2026-09-10 10:01:18 +02:00
Lucas Chollet c5653a7fc0 Meta: Use rsync in install-ports-tree.sh
This makes the script run a lot faster, ~250ms instead of 10s.
2026-09-10 10:01:18 +02:00
Lucas Chollet a0a627ab01 Kernel: Add a helper function to discard Interrupted in kernel processes 2026-09-03 19:21:56 +02:00
Lucas Chollet 44658063c0 Kernel: Introduce a EINTR-only error type
This class should be used instead of Error in code paths shared between
kernel and user processes that cannot fail, but may be interrupted while
running in a user process. This generally includes code that may block
on a WaitQueue or a Mutex.
2026-09-03 19:21:56 +02:00
Lucas Chollet c7c906265d Kernel: Return ENOENT on empty paths
AFAICT, this is what most syscalls specify:

[ENOENT]
    A component of the path prefix specified by path does not name an
    existing directory or path is an empty string.
2026-09-02 11:11:21 +02:00
Lucas Chollet 8492696450 AK: Handle edge cases correctly in exp 2026-08-31 19:39:31 +02:00