@@ -113,7 +113,7 @@ public extension DispatchSource {
113
113
}
114
114
#endif
115
115
116
- #if HAVE_MACH
116
+ #if !os(Linux)
117
117
public struct ProcessEvent : OptionSet , RawRepresentable {
118
118
public let rawValue : UInt
119
119
public init ( rawValue: UInt ) { self . rawValue = rawValue }
@@ -171,7 +171,7 @@ public extension DispatchSource {
171
171
}
172
172
#endif
173
173
174
- #if HAVE_MACH
174
+ #if !os(Linux)
175
175
public class func process( identifier: pid_t , eventMask: ProcessEvent , queue: DispatchQueue ? = nil ) -> DispatchSourceProcess {
176
176
let source = dispatch_source_create ( _swift_dispatch_source_type_proc ( ) , UInt ( identifier) , eventMask. rawValue, queue? . __wrapped)
177
177
return DispatchSource ( source: source) as DispatchSourceProcess
@@ -203,10 +203,12 @@ public extension DispatchSource {
203
203
return DispatchSource ( source: source) as DispatchSourceUserDataOr
204
204
}
205
205
206
+ #if !os(Linux)
206
207
public class func fileSystemObject( fileDescriptor: Int32 , eventMask: FileSystemEvent , queue: DispatchQueue ? = nil ) -> DispatchSourceFileSystemObject {
207
208
let source = dispatch_source_create ( _swift_dispatch_source_type_vnode ( ) , UInt ( fileDescriptor) , eventMask. rawValue, queue? . __wrapped)
208
209
return DispatchSource ( source: source) as DispatchSourceFileSystemObject
209
210
}
211
+ #endif
210
212
211
213
public class func write( fileDescriptor: Int32 , queue: DispatchQueue ? = nil ) -> DispatchSourceWrite {
212
214
let source = dispatch_source_create ( _swift_dispatch_source_type_write ( ) , UInt ( fileDescriptor) , 0 , queue? . __wrapped)
@@ -254,7 +256,7 @@ public extension DispatchSourceMemoryPressure {
254
256
}
255
257
#endif
256
258
257
- #if HAVE_MACH
259
+ #if !os(Linux)
258
260
public extension DispatchSourceProcess {
259
261
public var handle : pid_t {
260
262
return pid_t ( dispatch_source_get_handle ( self as! DispatchSource ) )
@@ -330,6 +332,7 @@ public extension DispatchSourceTimer {
330
332
}
331
333
}
332
334
335
+ #if !os(Linux)
333
336
public extension DispatchSourceFileSystemObject {
334
337
public var handle : Int32 {
335
338
return Int32 ( dispatch_source_get_handle ( ( self as! DispatchSource ) . __wrapped) )
@@ -345,6 +348,7 @@ public extension DispatchSourceFileSystemObject {
345
348
return DispatchSource . FileSystemEvent ( rawValue: data)
346
349
}
347
350
}
351
+ #endif
348
352
349
353
public extension DispatchSourceUserDataAdd {
350
354
/// @function mergeData
@@ -388,6 +392,7 @@ internal func _swift_dispatch_source_type_data_add() -> dispatch_source_type_t
388
392
@_silgen_name ( " _swift_dispatch_source_type_DATA_OR " )
389
393
internal func _swift_dispatch_source_type_data_or( ) -> dispatch_source_type_t
390
394
395
+ #if HAVE_MACH
391
396
@_silgen_name ( " _swift_dispatch_source_type_MACH_SEND " )
392
397
internal func _swift_dispatch_source_type_mach_send( ) -> dispatch_source_type_t
393
398
@@ -396,9 +401,12 @@ internal func _swift_dispatch_source_type_mach_recv() -> dispatch_source_type_t
396
401
397
402
@_silgen_name ( " _swift_dispatch_source_type_MEMORYPRESSURE " )
398
403
internal func _swift_dispatch_source_type_memorypressure( ) -> dispatch_source_type_t
404
+ #endif
399
405
406
+ #if !os(Linux)
400
407
@_silgen_name ( " _swift_dispatch_source_type_PROC " )
401
408
internal func _swift_dispatch_source_type_proc( ) -> dispatch_source_type_t
409
+ #endif
402
410
403
411
@_silgen_name ( " _swift_dispatch_source_type_READ " )
404
412
internal func _swift_dispatch_source_type_read( ) -> dispatch_source_type_t
@@ -409,8 +417,10 @@ internal func _swift_dispatch_source_type_signal() -> dispatch_source_type_t
409
417
@_silgen_name ( " _swift_dispatch_source_type_TIMER " )
410
418
internal func _swift_dispatch_source_type_timer( ) -> dispatch_source_type_t
411
419
420
+ #if !os(Linux)
412
421
@_silgen_name ( " _swift_dispatch_source_type_VNODE " )
413
422
internal func _swift_dispatch_source_type_vnode( ) -> dispatch_source_type_t
423
+ #endif
414
424
415
425
@_silgen_name ( " _swift_dispatch_source_type_WRITE " )
416
426
internal func _swift_dispatch_source_type_write( ) -> dispatch_source_type_t
0 commit comments