diff --git a/src/swift/IO.swift b/src/swift/IO.swift index 8ce417aa7..d26f64160 100644 --- a/src/swift/IO.swift +++ b/src/swift/IO.swift @@ -55,6 +55,7 @@ public extension DispatchIO { self.init(__type: type.rawValue, fd: fileDescriptor, queue: queue, handler: cleanupHandler) } + @available(swift, obsoleted: 4) public convenience init( type: StreamType, path: UnsafePointer, @@ -66,6 +67,18 @@ public extension DispatchIO { self.init(__type: type.rawValue, path: path, oflag: oflag, mode: mode, queue: queue, handler: cleanupHandler) } + @available(swift, introduced: 4) + public convenience init?( + type: StreamType, + path: UnsafePointer, + oflag: Int32, + mode: mode_t, + queue: DispatchQueue, + cleanupHandler: @escaping (_ error: Int32) -> Void) + { + self.init(__type: type.rawValue, path: path, oflag: oflag, mode: mode, queue: queue, handler: cleanupHandler) + } + public convenience init( type: StreamType, io: DispatchIO,