7
7
See https://swift.org/LICENSE.txt for license information
8
8
*/
9
9
10
- #if swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
10
+ #if false && swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
11
11
12
12
import Darwin. Mach
13
13
@@ -27,8 +27,7 @@ internal func _machPrecondition(
27
27
@available ( /*System 1.3.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8 , * )
28
28
@frozen
29
29
public enum Mach {
30
- @_moveOnly
31
- public struct Port < RightType: MachPortRight > {
30
+ public struct Port < RightType: MachPortRight > : ~ Copyable {
32
31
@usableFromInline
33
32
internal var _name : mach_port_name_t
34
33
@@ -122,24 +121,6 @@ public enum Mach {
122
121
/// receiving end.
123
122
@frozen
124
123
public struct SendOnceRight : MachPortRight { }
125
-
126
- /// Create a connected pair of rights, one receive, and one send.
127
- ///
128
- /// This function will abort if the rights could not be created.
129
- /// Callers may assert that valid rights are always returned.
130
- public static func allocatePortRightPair( ) ->
131
- ( receive: Mach . Port < Mach . ReceiveRight > , send: Mach . Port < Mach . SendRight > ) {
132
- var name = mach_port_name_t ( MACH_PORT_NULL)
133
- let secret = mach_port_context_t ( arc4random ( ) )
134
- withUnsafeMutablePointer ( to: & name) { name in
135
- var options = mach_port_options_t ( )
136
- options. flags = UInt32 ( MPO_INSERT_SEND_RIGHT) ;
137
- withUnsafeMutablePointer ( to: & options) { options in
138
- _machPrecondition ( mach_port_construct ( mach_task_self_, options, secret, name) )
139
- }
140
- }
141
- return ( Mach . Port ( name: name, context: secret) , Mach . Port ( name: name) )
142
- }
143
124
}
144
125
145
126
extension Mach . Port where RightType == Mach . ReceiveRight {
0 commit comments