             }
             // Create a thread and start reading the output on it.
             let thread = Thread {
-                self.readOutput(onFD: outputPipe[0])
+                self.stdout.result = self.readOutput(onFD: outputPipe[0])
             }
             thread.start()
-            readOutputThread = thread
+            self.stdout.thread = thread
         }
     }
 

            }
            
            // Construct the result.
            let outputResult = readOutputError.map(Result.init) ?? Result(output)
            let executionResult = ProcessResult(arguments: arguments, exitStatus: exitStatus, output: outputResult)
            self._result = executionResult
            return executionResult
        }
    }

    /// Reads the output from the passed fd and writes in the output variable
    /// after reading all of the data.
    private func readOutput(onFD fd: Int32) {
        // Read all of the data from the output pipe.
        let N = 4096
        var buf = [Int8](repeating: 0, count: N + 1)

                out += buf[0..<n]
            }
        }
        // Close the read end of the output pipe.
        close(fd)
        // Construct the output result.
        return error.map(Result.init) ?? Result(out)
    }

    /// Send a signal to the process.
