Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var package = Package(
dependencies: [
.package(
url: "https://github.com/PureSwift/Socket.git",
.branch("main")
from: "0.7.0"
)
],
targets: [
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/ErrorMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif

/// Netlink generic message payload.
public struct NetlinkErrorMessage: Error, NetlinkMessageProtocol {
Expand Down
8 changes: 8 additions & 0 deletions Sources/Netlink/Internal/CInterop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
// Created by Alsey Coleman Miller on 4/22/22.
//

#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket
#if canImport(System)
import SystemPackage
public typealias CInterop = SystemPackage.CInterop
#endif
@_implementationOnly import CNetlink
#if canImport(Glibc)
import Glibc
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/Internal/CSocketAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
// Created by Alsey Coleman Miller on 4/22/22.
//

#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket

internal protocol CSocketAddress {
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/Internal/Linux.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket
@_implementationOnly import CNetlink

Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/Internal/Syscalls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import Glibc
#elseif canImport(Darwin)
import Darwin
#endif
#if canImport(System)
import System
#else
import SystemPackage
#endif

@usableFromInline
internal func system_getpid() -> CInterop.ProcessID {
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/ProcessID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//
//

#if canImport(System)
import System
#else
import SystemPackage
#endif

/// POSIX Process ID
@frozen
Expand Down
6 changes: 5 additions & 1 deletion Sources/Netlink/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket
@_implementationOnly import CNetlink

Expand Down Expand Up @@ -39,7 +43,7 @@ public final class NetlinkSocket {
processID: .current,
group: group
)
try fileDescriptor.closeIfThrows { () throws(Errno) in
try fileDescriptor.closeIfThrows { () throws(SystemPackage.Errno) in
try fileDescriptor.bind(address)
}
// initialize socket
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/SocketAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket

@frozen
Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/SocketOption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket
@_implementationOnly import CNetlink

Expand Down
4 changes: 4 additions & 0 deletions Sources/Netlink/SocketProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
//

import Foundation
#if canImport(System)
import System
#else
import SystemPackage
#endif
import Socket
@_implementationOnly import CNetlink

Expand Down
4 changes: 4 additions & 0 deletions Sources/NetlinkGeneric/Internal/CInterop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
// Created by Alsey Coleman Miller on 4/22/22.
//

#if canImport(System)
import System
#else
import SystemPackage
#endif
@_implementationOnly import CNetlink
#if canImport(Glibc)
import Glibc
Expand Down
Loading