Sync the relibc fork with 50 upstream commits (socket layer rework,
exec/signal/ptrace/path/timer updates, pthread cleanup, ld_so lifecycle
work bringing mark_ready/run_fini into the tree, dynamically-linked
init support, start.rs allocator-model rewrite, test harness updates).
Satisfies the verify-fork-functions gate (2 previously-missing ld_so
functions now present).
Conflicts resolved (4 files; 46 auto-merged):
- src/start.rs: took upstream's version wholesale. Upstream moved
allocator/linker initialization into ld_so's new lifecycle (the
mark_ready/run_fini work this merge brings in), superseding the RB
alloc_init cluster; the old model's function was already merged out
and its lone call would not compile.
- redox-rt/src/sys.rs: kept the RB refresh flow with the non-fatal
lseek fallback (upstream adopted the refresh as a fatal '?' —
RB's conservative fallback protects spawn for uid-dropped /
namespace-restricted exec where the kernel cannot refresh).
- src/platform/redox/exec.rs: kept the RB root exec-permission bypass
(ruid/euid != 0 gate, Linux-matching behavior).
- Cargo.lock: syn 2.0.118 -> 2.0.119 (upstream).
Verified: repo cook relibc --force-rebuild successful;
verify-fork-functions.sh --no-fetch relibc passes;
all 9 forks now pass the gate.
The sys_timerfd module (timerfd_create/settime/gettime) existed on disk but was
never declared in header/mod.rs, so its code was NOT compiled and the symbols
were absent from libc — timerfd was entirely non-functional. The generated
header still declared the functions, so C programs compiled but failed to LINK
with 'undefined reference to timerfd_create/timerfd_settime' (e.g. libwayland's
event-loop.c, blocking the whole Wayland stack). Declare the module so the
implementation is built and the symbols exported.
cbindgen auto-generated the timerfd_* prototypes from the Rust signatures,
emitting a bare 'itimerspec' (not 'struct itimerspec') and a 'clockid_t'
parameter with no <time.h> in scope, so any C program that #includes
<sys/timerfd.h> failed to compile. That made meson's TFD_CLOEXEC feature probe
report NO and aborted the whole Wayland stack (libwayland) and glib. Exclude the
auto-generated prototypes (the hand-written, correct ones are emitted from the
trailer) and add <time.h> to the sys_includes.
Adapted from the archived local P3-waitid.patch. Fills a POSIX gap needed by
job-control-capable shells (brush/nix). waitid() maps (idtype,id)->waitpid pid,
translates WEXITED/WSTOPPED/WCONTINUED/WNOWAIT options, and populates siginfo_t
(si_pid/si_signo/si_code/si_status) from the wait status.
bits/eventfd.h defines the eventfd_t 64-bit counter type used by
sys/eventfd.h. Without this config, cbindgen skipped the directory
and the type wasn't generated.
sys_timerfd was fully implemented in Rust (timerfd_create,
timerfd_settime, timerfd_gettime, itimerspec support) but lacked
the cbindgen.toml needed to generate the <sys/timerfd.h> C header.
Qt6's QSocketNotifier and many other C programs depend on this header.
Without it, cbindgen skips the directory entirely.
This adds the cbindgen config + trailer with all function prototypes,
matching the pattern used by sys_signalfd.
Generated signal.h uses uint32_t, int32_t, uint64_t, uintptr_t etc.
without including stdint.h, causing compilation failures in C packages
that include signal.h (diffutils, etc).
Creates sys_eventfd header module providing eventfd(), eventfd_read(),
and eventfd_write(). Uses the kernel event scheme (/scheme/event) on
Redox, returning ENOSYS on Linux. Required for packages like Python
that link against eventfd.