We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Process.processID
1 parent f0017d7 commit ede125cCopy full SHA for ede125c
Sources/TSCBasic/Process.swift
@@ -177,6 +177,8 @@ public final class Process: ObjectIdentifierProtocol {
177
/// Typealias for process id type.
178
#if !os(Windows)
179
public typealias ProcessID = pid_t
180
+ #else
181
+ public typealias ProcessID = Int32
182
#endif
183
184
/// Typealias for stdout/stderr output closure.
@@ -206,6 +208,9 @@ public final class Process: ObjectIdentifierProtocol {
206
208
/// The process id of the spawned process, available after the process is launched.
207
209
#if os(Windows)
210
private var _process: Foundation.Process?
211
+ public var processID: ProcessID {
212
+ return _process?.processIdentifier ?? 0
213
+ }
214
#else
215
public private(set) var processID = ProcessID()
216
0 commit comments