Adds FreeBSD CMSG helpers and resolve MemberImportVisibility errors#3594
Draft
rafaelcepeda wants to merge 14 commits into
Draft
Adds FreeBSD CMSG helpers and resolve MemberImportVisibility errors#3594rafaelcepeda wants to merge 14 commits into
rafaelcepeda wants to merge 14 commits into
Conversation
f9abceb to
efbfccd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds FreeBSD CMSG function bindings in
BSDSocketAPIPosix.swiftand addimport CNIOFreeBSDacross all NIOPosix files that access struct members defined by FreeBSD system headers.Motivation:
After wiring
CNIOFreeBSDinSystem.swift, the remaining build errors on FreeBSD were: (1)BSDSocketAPIPosix.swiftreferencingCNIOLinux_CMSG_*functions that don't exist on FreeBSD, (2) dozens ofMemberImportVisibilityerrors where files access struct members (msg_hdr,msg_len,sin_addr,sa_family,iov_base, etc.) without importing the defining module, and (3)F_SETNOSIGPIPEnot existing on FreeBSD.Modifications:
#elseif os(FreeBSD)case inBSDSocketAPIPosix.swiftwiring all 6 CMSG helpers toCNIOFreeBSD_CMSG_*functions.import CNIOFreeBSDto: BaseSocket.swift, DatagramVectorReadManager.swift, PendingDatagramWritesManager.swift, PendingWritesManager.swift, Socket.swift, SocketChannel.swift.ControlMessage.swifttoimport CNIOFreeBSDinstead ofCNIOLinuxon FreeBSD.os(FreeBSD)to the global SIGPIPE-ignoring path inSocketProtocols.swift(FreeBSD doesn't haveF_SETNOSIGPIPE).Result:
NIOPosix error count on FreeBSD drops from 75 to 12. Remaining errors are: Vsock support (FreeBSD doesn't have
AF_VSOCK), missingin_pktinfotype, andgloballyIgnoredSIGPIPEnot being defined for FreeBSD.