HomeFreeBSD

daemon: use kqueue for all events

Description

daemon: use kqueue for all events

Refactor daemon to use kqueue/kevent instead of signals.

This changes allows to simplify the code in several ways:

  • the execution flow is now linear, no async events.
  • several variables became redundant and got removed.
  • all event handling is now concentrated inside of the event loop, which makes code reading and comprehension easier.
  • new kqueuex(2) call is used for CLOEXEC, but maintained closing the kq fd prior to execve() to ease later MFC

No UX/API changes are intended.

Reviewed by: kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/701

(cherry picked from commit 8935a3993219be76c7ea03e9ad4509657d08af6c)

Details

Provenance
ihor_antonovs.familyAuthored on Apr 14 2023, 5:10 AM
desCommitted on Dec 13 2023, 4:21 PM
Parents
rG06c9bece28c3: growfs: make exit codes more consistent
Branches
Unknown
Tags
Unknown