]> git.saurik.com Git - apple/libdispatch.git/blobdiff - src/swift/IO.swift
libdispatch-913.30.4.tar.gz
[apple/libdispatch.git] / src / swift / IO.swift
index 8ce417aa74d984b9f610796949ef91d6ece73e18..d26f6416063ac35b393131a97de3d82e562b522a 100644 (file)
@@ -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<Int8>,
@@ -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<Int8>,
+               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,