Skip to content

[ISSUE] Phase 2: Complete Event Loop Syscalls (signalfd4 and epoll_pwait2) #280

Todo
0 of 2 issues completed

Description

@marcobuschini

Parent Epic

#265

Blocked By / Dependencies

#279 (Phase 1 — signal masking/delivery completeness for signalfd4)

Problem Statement & Context

Issue #264 (PR #278) already delivered the core Wayland event-loop primitives (epoll_create1, epoll_ctl, epoll_pwait, eventfd2, timerfd_create, timerfd_settime, timerfd_gettime, memfd_create, MAP_SHARED on tmpfs, and SCM_RIGHTS). Two Phase 2 event-loop syscalls remain for full modern Linux event-loop parity: signalfd4 (74) for unified signal handling inside epoll, and epoll_pwait2 (441) for nanosecond struct timespec timeouts used by newer glibc/libuv/glib/wlroots runtimes.

Scope & Technical Touchpoints

In Scope

  • linux_signalfd_siginfo (128 bytes, LP64 static_asserted) in kernel/uapi/event.hpp
  • SignalFd kernel object in kernel/ipc/EventLoop.{hpp,cpp} wired into VFS FileOperations (read, poll, release)
  • sys_signalfd4 (74) and sys_epoll_pwait2 (441) in kernel/syscalls/EventSyscalls.cpp & kernel/syscalls/SyscallDispatcher.cpp
  • Host ASan/UBSan and QEMU EL0 regression tests

Technical Touchpoints

  • kernel/uapi/event.hpp
  • kernel/ipc/EventLoop.hpp, kernel/ipc/EventLoop.cpp
  • kernel/process/Signal.hpp, kernel/process/Signal.cpp
  • kernel/syscalls/EventSyscalls.cpp, kernel/syscalls/SyscallInternal.hpp, kernel/syscalls/SyscallDispatcher.cpp
  • tests/host/, kernel/shell/tests/

Out of Scope

Split Verdict: SPLIT

Rationale: Separating the UAPI + kernel SignalFd/epoll_pwait2 implementation from the comprehensive host & QEMU verification suite keeps the core IPC diff focused and easy to review.

Subissues

Acceptance Criteria

  • signalfd4 (SFD_NONBLOCK, SFD_CLOEXEC, mask updates on existing FD) dequeues pending masked signals and integrates cleanly with epoll_pwait / epoll_pwait2
  • epoll_pwait2 honors struct timespec timeouts (null, zero, sub-millisecond, invalid negative -> -EINVAL) and atomic sigmask swaps
  • Host Snitch ASan/UBSan tests and QEMU shell tests verify zero VFS/heap/PFA leaks
  • make format && make clean-tests && make -j"$(nproc)" all && make -j"$(nproc)" quality passes with zero warnings

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Metadata

Metadata

Assignees

Labels

enhancementipc

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions