@@ -88,14 +88,14 @@ extension Configuration {
8888
8989 // Spawn
9090 var pid : pid_t = 0
91- var processFileDescriptor : PlatformFileDescriptor = - 1
91+ var processDescriptor : PlatformFileDescriptor = - 1
9292 let spawnError : CInt = possibleExecutablePath. withCString { exePath in
9393 return ( self . workingDirectory? . string) . withOptionalCString { workingDir in
9494 return supplementaryGroups. withOptionalUnsafeBufferPointer { sgroups in
9595 return fileDescriptors. withUnsafeBufferPointer { fds in
9696 return _subprocess_fork_exec (
9797 & pid,
98- & processFileDescriptor ,
98+ & processDescriptor ,
9999 exePath,
100100 workingDir,
101101 fds. baseAddress!,
@@ -145,7 +145,7 @@ extension Configuration {
145145 let execution = Execution (
146146 processIdentifier: . init(
147147 value: pid,
148- processFileDescriptor : processFileDescriptor
148+ processDescriptor : processDescriptor
149149 )
150150 )
151151 return SpawnResult (
@@ -191,16 +191,16 @@ extension Configuration {
191191public struct ProcessIdentifier : Sendable , Hashable {
192192 /// The platform specific process identifier value
193193 public let value : pid_t
194- internal let processFileDescriptor : PlatformFileDescriptor
194+ internal let processDescriptor : PlatformFileDescriptor
195195
196- internal init ( value: pid_t , processFileDescriptor : PlatformFileDescriptor ) {
196+ internal init ( value: pid_t , processDescriptor : PlatformFileDescriptor ) {
197197 self . value = value
198- self . processFileDescriptor = processFileDescriptor
198+ self . processDescriptor = processDescriptor
199199 }
200200
201201 internal func close( ) {
202- if self . processFileDescriptor > 0 {
203- _SubprocessCShims. close ( self . processFileDescriptor )
202+ if self . processDescriptor > 0 {
203+ _SubprocessCShims. close ( self . processDescriptor )
204204 }
205205 }
206206}
@@ -304,16 +304,16 @@ internal func monitorProcessTermination(
304304 // pidfd is only supported on Linux kernel 5.4 and above
305305 // On older releases, use signalfd so we do not need
306306 // to register anything with epoll
307- if processIdentifier. processFileDescriptor > 0 {
308- // Register processFileDescriptor with epoll
307+ if processIdentifier. processDescriptor > 0 {
308+ // Register processDescriptor with epoll
309309 var event = epoll_event (
310310 events: EPOLLIN . rawValue,
311- data: epoll_data ( fd: processIdentifier. processFileDescriptor )
311+ data: epoll_data ( fd: processIdentifier. processDescriptor )
312312 )
313313 let rc = epoll_ctl (
314314 storage. epollFileDescriptor,
315315 EPOLL_CTL_ADD,
316- processIdentifier. processFileDescriptor ,
316+ processIdentifier. processDescriptor ,
317317 & event
318318 )
319319 if rc != 0 {
@@ -326,7 +326,7 @@ internal func monitorProcessTermination(
326326 }
327327 // Now save the registration
328328 var newState = storage
329- newState. continuations [ processIdentifier. processFileDescriptor ] = continuation
329+ newState. continuations [ processIdentifier. processDescriptor ] = continuation
330330 state = . started( newState)
331331 // No state to resume
332332 return nil
@@ -342,7 +342,7 @@ internal func monitorProcessTermination(
342342 if siginfo. si_pid == 0 && siginfo. si_signo == 0 {
343343 // Save this continuation to be called by signal hander
344344 var newState = storage
345- newState. continuations [ processIdentifier. processFileDescriptor ] = continuation
345+ newState. continuations [ processIdentifier. processDescriptor ] = continuation
346346 state = . started( newState)
347347 return nil
348348 }
@@ -421,7 +421,7 @@ private extension siginfo_t {
421421// Okay to be unlocked global mutable because this value is only set once like dispatch_once
422422private nonisolated ( unsafe) var _signalPipe: ( readEnd: CInt , writeEnd: CInt ) = ( readEnd: - 1 , writeEnd: - 1 )
423423// Okay to be unlocked global mutable because this value is only set once like dispatch_once
424- private nonisolated ( unsafe) var _waitProcessFileDescriptorSupported = false
424+ private nonisolated ( unsafe) var _waitprocessDescriptorSupported = false
425425private let _processMonitorState : Mutex < ProcessMonitorState > = . init( . notStarted)
426426
427427private func shutdown( ) {
@@ -520,8 +520,8 @@ private func monitorThreadFunc(args: UnsafeMutableRawPointer?) -> UnsafeMutableR
520520 }
521521
522522 // P_PIDFD requires Linux Kernel 5.4 and above
523- if _waitProcessFileDescriptorSupported {
524- _blockAndWaitForProcessFileDescriptor ( targetFileDescriptor, context: context)
523+ if _waitprocessDescriptorSupported {
524+ _blockAndWaitForprocessDescriptor ( targetFileDescriptor, context: context)
525525 } else {
526526 _reapAllKnownChildProcesses ( targetFileDescriptor, context: context)
527527 }
@@ -573,7 +573,7 @@ private let setup: () = {
573573
574574 // If the current kernel does not support pidfd, fallback to signal handler
575575 // Create the self-pipe that signal handler writes to
576- if !_isWaitProcessFileDescriptorSupported ( ) {
576+ if !_isWaitprocessDescriptorSupported ( ) {
577577 var pipeCreationError : SubprocessError ? = nil
578578 do {
579579 let ( readEnd, writeEnd) = try FileDescriptor . pipe ( )
@@ -612,7 +612,7 @@ private let setup: () = {
612612 }
613613 } else {
614614 // Mark waitid(P_PIDFD) as supported
615- _waitProcessFileDescriptorSupported = true
615+ _waitprocessDescriptorSupported = true
616616 }
617617 let monitorThreadContext = MonitorThreadContext (
618618 epollFileDescriptor: epollFileDescriptor,
@@ -645,7 +645,7 @@ private func _setupMonitorSignalHandler() {
645645 setup
646646}
647647
648- private func _blockAndWaitForProcessFileDescriptor ( _ pidfd: CInt , context: MonitorThreadContext ) {
648+ private func _blockAndWaitForprocessDescriptor ( _ pidfd: CInt , context: MonitorThreadContext ) {
649649 var terminationStatus : Result < TerminationStatus , SubprocessError >
650650
651651 var siginfo = siginfo_t ( )
@@ -760,7 +760,7 @@ private func _reapAllKnownChildProcesses(_ signalFd: CInt, context: MonitorThrea
760760 }
761761}
762762
763- internal func _isWaitProcessFileDescriptorSupported ( ) -> Bool {
763+ internal func _isWaitprocessDescriptorSupported ( ) -> Bool {
764764 // waitid(P_PIDFD) is only supported on Linux kernel 5.4 and above
765765 // Prob whether the current system supports it by calling it with self pidfd
766766 // and checking for EINVAL (waitid sets errno to EINVAL if it does not
0 commit comments