diff --git a/Sources/System/IORing.swift b/Sources/System/IORing.swift index 6e31a42..15d9cd7 100644 --- a/Sources/System/IORing.swift +++ b/Sources/System/IORing.swift @@ -1,6 +1,11 @@ #if os(Linux) import CSystem -import Glibc // needed for mmap +// needed for mmap +#if canImport(Glibc) +import Glibc +#elseif canImport(Musl) +import Musl +#endif import Synchronization extension UnsafeMutableRawPointer { diff --git a/Tests/SystemTests/IORequestTests.swift b/Tests/SystemTests/IORequestTests.swift index 0e5c972..4d32196 100644 --- a/Tests/SystemTests/IORequestTests.swift +++ b/Tests/SystemTests/IORequestTests.swift @@ -1,3 +1,4 @@ +#if os(Linux) import XCTest #if SYSTEM_PACKAGE @@ -27,3 +28,4 @@ final class IORequestTests: XCTestCase { XCTAssertEqual(sourceBytes, .init(repeating: 0, count: 64)) } } +#endif diff --git a/Tests/SystemTests/IORingTests.swift b/Tests/SystemTests/IORingTests.swift index 8b32b92..29973c6 100644 --- a/Tests/SystemTests/IORingTests.swift +++ b/Tests/SystemTests/IORingTests.swift @@ -1,3 +1,4 @@ +#if os(Linux) import XCTest import CSystem //for eventfd @@ -98,3 +99,4 @@ final class IORingTests: XCTestCase { rawBuffer.deallocate() } } +#endif