File tree 1 file changed +13
-2
lines changed
Sources/Mach/Core/Messaging/MIG
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,13 @@ import Darwin.Mach
2
2
import Foundation
3
3
4
4
extension Mach {
5
- /// A client for a MIG subsystem .
5
+ /// A client for MIG requests .
6
6
open class MIGClient : Mach . Port {
7
7
/// The base routine ID for the remote MIG subsystem.
8
- public var baseRoutineId : mach_msg_id_t = 0
8
+ /// - Warning: The vast majority of the time, this should not change after initialization. However, it is left as a
9
+ /// variable for advanced cases (such as when multiple MIG subsystems are available through the same port), as well
10
+ /// as to allow it to be set by convenience initializers (after the actual initializer has been called).
11
+ public var baseRoutineId : mach_msg_id_t
9
12
10
13
/// Represents an existing MIG server port.
11
14
public required init ( named name: mach_port_name_t , baseRoutineId: mach_msg_id_t ) {
@@ -72,3 +75,11 @@ extension Mach {
72
75
}
73
76
}
74
77
}
78
+
79
+ extension Mach . PortInitializableByServiceName where Self: Mach . MIGClient {
80
+ /// Obtains a MIG client for the given service.
81
+ public init ( serviceName: String , baseRoutineId: mach_msg_id_t ) throws {
82
+ try self . init ( serviceName: serviceName)
83
+ self . baseRoutineId = baseRoutineId
84
+ }
85
+ }
You can’t perform that action at this time.
0 commit comments