Page MenuHomeFreeBSD

signalfd: Add native support for Linux's signalfd
Needs ReviewPublic

Authored by jfree on Jun 28 2023, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 6:27 AM
Unknown Object (File)
Sat, Oct 4, 5:44 AM
Unknown Object (File)
Aug 30 2025, 3:13 AM
Unknown Object (File)
Aug 24 2025, 9:18 AM
Unknown Object (File)
Aug 15 2025, 3:52 PM
Unknown Object (File)
Aug 6 2025, 10:34 AM
Unknown Object (File)
Jul 31 2025, 1:40 AM
Unknown Object (File)
Jul 6 2025, 9:48 AM
Subscribers

Details

Summary
signalfd: Add native support for Linux's signalfd

The signalfd system call handles signals using a special signalfd file
descriptor. The caller may specify a mask of signals for signalfd to
catch. When the desciptor is read, it will return a signalfd_siginfo
structure populated with signal information from the sigqueue, similar
to sigwaitinfo(2).

The signalfd descriptor maintains traditional file descriptor semantics,
so it may be passed to other processes, preserved across fork(2), and
monitored via kevent(2), poll(2), or select(2).

This signalfd interface is based on the behavior of Linux's signalfd
implementation. It was designed to be drop-in compatible with existing
Linux signalfd code.
Test Plan

This implementation passes all of epoll-shim's signalfd tests:
https://github.com/jiixyj/epoll-shim/blob/master/test/signalfd-test.c

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped