Skip to content

v3.3.0

Choose a tag to compare

@g2px1 g2px1 released this 10 Nov 21:08
· 116 commits to main since this release
3222576

Release 3.3.0 — BSD/macOS Compatibility and Poller Integration

Overview

This release introduces BSD/macOS compatibility for the asynchronous socket acceptor and event removal logic within the uvent core. It replaces Linux-specific accept4 and epoll_ctl with proper BSD/macOS equivalents using accept + fcntl and kqueue respectively.

Changes

  • async_accept()

    • Added fallback for platforms without accept4 (macOS, NetBSD, OpenBSD).
    • Implemented accept() + fcntl(F_SETFL, O_NONBLOCK) + FD_CLOEXEC.
    • Added SO_NOSIGPIPE to prevent unwanted SIGPIPE on macOS.
    • Preserved EINTR handling and unified error handling logic.
    • Retained IPv4/IPv6 address propagation.
  • Poller backend

    • In KQueue replaced epoll_ctl(..., EPOLL_CTL_DEL, ...) with alternative:

      EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, nullptr);
      kevent(kqueue_fd, &ev, 1, nullptr, 0, nullptr);

      ensuring proper kqueue event removal for both EVFILT_READ and EVFILT_WRITE.

Impact

  • Enables uvent to compile and operate correctly on BSD and macOS.
  • No behavioral changes on Linux.
  • Improves portability and reliability across POSIX environments.

Testing

  • Verified async accept/connect cycle on MacOS 15.6 (24G84) and FreeBSD 14.
  • Confirmed non-blocking sockets and SIGPIPE suppression.
  • Validated event deletion behavior under kqueue without memory leaks or stale descriptors.