Skip to content

Fix in_pktinfo, disable Vsock, and fix SHUT_* constants on FreeBSD#3595

Draft
rafaelcepeda wants to merge 16 commits into
apple:mainfrom
rafaelcepeda:freebsd-final-fixes
Draft

Fix in_pktinfo, disable Vsock, and fix SHUT_* constants on FreeBSD#3595
rafaelcepeda wants to merge 16 commits into
apple:mainfrom
rafaelcepeda:freebsd-final-fixes

Conversation

@rafaelcepeda

Copy link
Copy Markdown
Contributor

Resolve the final FreeBSD build errors to achieve a clean NIOPosix compilation on FreeBSD.

Motivation:

After the previous PR added import CNIOFreeBSD and per-socket SO_NOSIGPIPE handling, 6 errors remained: (1) FreeBSD doesn't have the in_pktinfo struct (it uses IP_RECVDSTADDR instead), (2) FreeBSD doesn't support AF_VSOCK, and (3) SHUT_RD/SHUT_WR/SHUT_RDWR are imported as a shutdown_how enum requiring .rawValue access.

Modifications:

  • ControlMessage.swift — Added !os(FreeBSD) to the in_pktinfo exclusion guard (matching OpenBSD pattern). - SocketChannel.swift — Added os(FreeBSD) to all three Vsock exclusion guards.
  • System.swift — Changed SHUT_* constants to use CNIOFreeBSD.SHUT_*.rawValue.

Result:

NIOPosix compiles with zero errors on FreeBSD 15. Error count drops from 6 to 0. Combined with the previous PRs, this completes the FreeBSD port of NIOPosix (from 101 errors to a clean build).

@rafaelcepeda rafaelcepeda added the 🔨 semver/patch No public API change. label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant