Skip to content

Expanded support for musl/linux syscalls (sysinfo, getrusage, prlimit64, umask, fchmodat) - #183

Merged
FlareCoding merged 6 commits into
masterfrom
pr/syscall-additions
Sep 1, 2026
Merged

Expanded support for musl/linux syscalls (sysinfo, getrusage, prlimit64, umask, fchmodat)#183
FlareCoding merged 6 commits into
masterfrom
pr/syscall-additions

Conversation

@FlareCoding

@FlareCoding FlareCoding commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Note

Low Risk
Additive syscall and per-process metadata with stub chmod/umask behavior; prlimit limits are stored but not newly enforced on open/stack paths in this diff.

Overview
Adds several Linux/musl-facing syscalls and wires them into the aarch64/x86_64 syscall number tables and syscall_table.cpp.

Process state: Each thread_group now holds per-process resource limits (rlimits) and a umask. New processes inherit both from the creator (POSIX-style) or get defaults (init_default_rlimits, umask 022). prlimit64 reads/writes limits for the caller’s PID only (with validation); umask atomically swaps the mask under the group lock.

Reporting syscalls: sysinfo fills uptime, RAM totals/free from the PMM, and a live process count. getrusage returns mostly-zero rusage except CPU time from run_ticks (all counted as user time; children are zero).

Permission stubs: fchmodat / x86 chmod resolve the path like other *at handlers and succeed without changing modes (VFS has no stored mode bits). Same pattern as existing faccessat stubs.

Kernel unit tests cover EINVAL/EFAULT/ESRCH edge cases; fuller behavior is left to userland.

Reviewed by Cursor Bugbot for commit 27acf54. Bugbot is set up for automated code reviews on this repo. Configure here.

…ries

Programs that size their working memory from sysconf(_SC_PHYS_PAGES),
compilers and language runtimes among them, reach the kernel through
sysinfo. The handler reports uptime from the monotonic clock, memory
from the pmm page counters, and the task count from the registry,
with the swap and load fields zeroed since no such accounting exists.
Toolchain programs collect timing statistics through getrusage and
read the result structure even when the call fails, which reported
uninitialized stack memory as timings. CPU time now comes from the
per-task run tick counters, summed across the task group for
RUSAGE_SELF, with all time reported as user time since no user versus
kernel split is accounted.
@FlareCoding FlareCoding changed the title Expanded support for musl/linux syscalls Expanded support for musl/linux syscalls (sysinfo, getrusage, prlimit64, umask, fchmodat) Sep 1, 2026
cursor[bot]

This comment was marked as resolved.

@FlareCoding
FlareCoding merged commit 8a73eb9 into master Sep 1, 2026
19 checks passed
@FlareCoding
FlareCoding deleted the pr/syscall-additions branch September 1, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant