From ef79522144b700758d46b4b5fd4a050ebaf304b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:24:52 +0000 Subject: [PATCH 1/2] Backport .NET 11 Process API docs from dotnet/runtime --- xml/System.Diagnostics/Process.xml | 241 ++++++++++++++----- xml/System.Diagnostics/ProcessExitStatus.xml | 35 ++- xml/System.Diagnostics/ProcessOutputLine.xml | 18 +- xml/System.Diagnostics/ProcessStartInfo.xml | 122 +++++++--- xml/System.Diagnostics/ProcessTextOutput.xml | 30 +-- 5 files changed, 316 insertions(+), 130 deletions(-) diff --git a/xml/System.Diagnostics/Process.xml b/xml/System.Diagnostics/Process.xml index e6842c10505..ef7cf306adc 100644 --- a/xml/System.Diagnostics/Process.xml +++ b/xml/System.Diagnostics/Process.xml @@ -3754,10 +3754,17 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. + The maximum amount of time to wait for the streams to be fully read. When , waits indefinitely. + Reads all standard output and standard error of the process as byte arrays. + A tuple containing the standard output and standard error bytes. To be added. + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The operation did not complete within the specified . + The process has been disposed. @@ -3791,10 +3798,17 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. + A token to cancel the asynchronous operation. + Asynchronously reads all standard output and standard error of the process as byte arrays. + A task that represents the asynchronous read operation. The value of the task contains a tuple with the standard output and standard error bytes. To be added. + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The was canceled. + The process has been disposed. @@ -3818,10 +3832,21 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + The maximum amount of time to wait for the streams to be fully read. When , waits indefinitely. + Reads all standard output and standard error of the process as lines of text, interleaving them as they become available. + An enumerable of instances representing the lines read from standard output and standard error. + + + + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The operation did not complete within the specified . + The process has been disposed. @@ -3845,10 +3870,21 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + A token to cancel the asynchronous operation. + Asynchronously reads all standard output and standard error of the process as lines of text, interleaving them as they become available. + An async enumerable of instances representing the lines read from standard output and standard error. + + + + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The was canceled. + The process has been disposed. @@ -3882,10 +3918,17 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. + The maximum amount of time to wait for the streams to be fully read. When , waits indefinitely. + Reads all standard output and standard error of the process as text. + A tuple containing the standard output and standard error text. To be added. + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The operation did not complete within the specified . + The process has been disposed. @@ -3919,10 +3962,17 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. + A token to cancel the asynchronous operation. + Asynchronously reads all standard output and standard error of the process as text. + A task that represents the asynchronous read operation. The value of the task contains a tuple with the standard output and standard error text. To be added. + Standard output or standard error has not been redirected. + +-or- + +A redirected stream has already been used for synchronous or asynchronous reading. + The was canceled. + The process has been disposed. @@ -4075,11 +4125,15 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + The that contains the information used to start the process. + The maximum amount of time to wait for the process to exit. When , waits indefinitely. If the process does not exit within the specified timeout, it is killed. + Starts the process described by , waits for it to exit, and returns its exit status. + The exit status of the process. To be added. + + is . + + is set to . @@ -4126,12 +4180,16 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. - To be added. + The name of the application or document to start. + The command-line arguments to pass to the process. Pass or an empty list to start the process without additional arguments. + The maximum amount of time to wait for the process to exit. When , waits indefinitely. If the process does not exit within the specified timeout, it is killed. + Starts a process with the specified file name and optional arguments, waits for it to exit, and returns its exit status. + The exit status of the process. To be added. + + is . + + is empty. @@ -4170,11 +4228,19 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + The that contains the information used to start the process. + The maximum amount of time to wait for the process to exit. When , waits indefinitely. If the process does not exit within the specified timeout, it is killed. + Starts the process described by , captures its standard output and error, waits for it to exit, and returns the captured text and exit status. + The captured text output and exit status of the process. To be added. + + is . + + is set to . + +-or- + + or is not set to . @@ -4221,12 +4287,16 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. - To be added. + The name of the application or document to start. + The command-line arguments to pass to the process. Pass or an empty list to start the process without additional arguments. + The maximum amount of time to wait for the process to exit. When , waits indefinitely. If the process does not exit within the specified timeout, it is killed. + Starts a process with the specified file name and optional arguments, captures its standard output and error, waits for it to exit, and returns the captured text and exit status. + The captured text output and exit status of the process. To be added. + + is . + + is empty. @@ -4265,11 +4335,19 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + The that contains the information used to start the process. + A token to cancel the asynchronous operation. If the token is canceled, the process is killed. + Asynchronously starts the process described by , captures its standard output and error, waits for it to exit, and returns the captured text and exit status. + A task that represents the asynchronous operation. The value of the task contains the captured text output and exit status of the process. To be added. + + is . + + is set to . + +-or- + + or is not set to . @@ -4316,12 +4394,16 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. - To be added. + The name of the application or document to start. + The command-line arguments to pass to the process. Pass or an empty list to start the process without additional arguments. + A token to cancel the asynchronous operation. If the token is canceled, the process is killed. + Asynchronously starts a process with the specified file name and optional arguments, captures its standard output and error, waits for it to exit, and returns the captured text and exit status. + A task that represents the asynchronous operation. The value of the task contains the captured text output and exit status of the process. To be added. + + is . + + is empty. @@ -4360,11 +4442,15 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. + The that contains the information used to start the process. + A token to cancel the asynchronous operation. If the token is canceled, the process is killed. + Asynchronously starts the process described by , waits for it to exit, and returns its exit status. + A task that represents the asynchronous operation. The value of the task contains the exit status of the process. To be added. + + is . + + is set to . @@ -4411,12 +4497,16 @@ A thread in a process can migrate from processor to processor, with each migrati - To be added. - To be added. - To be added. - To be added. - To be added. + The name of the application or document to start. + The command-line arguments to pass to the process. Pass or an empty list to start the process without additional arguments. + A token to cancel the asynchronous operation. If the token is canceled, the process is killed. + Asynchronously starts a process with the specified file name and optional arguments, waits for it to exit, and returns its exit status. + A task that represents the asynchronous operation. The value of the task contains the exit status of the process. To be added. + + is . + + is empty. @@ -5502,10 +5592,23 @@ The file specified in the could not be found. - To be added. - To be added. - To be added. - To be added. + The that contains the information used to start the process. + Starts the process described by , releases all associated resources, and returns the process ID. + The process ID of the started process. + + , , or ) is not provided, it is redirected to the null file by default. + +This method is designed for fire-and-forget scenarios where the caller wants to launch a process and does not need to interact with it further. It starts the process, releases all associated resources, and returns the process ID. The started process continues to run independently. + ]]> + + + is . + One or more of , , or is set to . Stream redirection is not supported in fire-and-forget scenarios because redirected streams must be drained to avoid deadlocks. + +-or- + + is set to . Shell execution is not supported in fire-and-forget scenarios because on Windows it may not create a new process, making it impossible to return a valid process ID. @@ -5551,11 +5654,19 @@ The file specified in the could not be found. - To be added. - To be added. - To be added. - To be added. - To be added. + The name of the application or document to start. + The command-line arguments to pass to the process. Pass or an empty list to start the process without additional arguments. + Starts a process with the specified file name and optional arguments, releases all associated resources, and returns the process ID. + The process ID of the started process. + + + + + is . diff --git a/xml/System.Diagnostics/ProcessExitStatus.xml b/xml/System.Diagnostics/ProcessExitStatus.xml index 85201bfd8c0..c16d0fc9935 100644 --- a/xml/System.Diagnostics/ProcessExitStatus.xml +++ b/xml/System.Diagnostics/ProcessExitStatus.xml @@ -14,7 +14,7 @@ - To be added. + Represents the exit status of a process. To be added. @@ -35,10 +35,10 @@ - To be added. - To be added. - To be added. - To be added. + The exit code of the process. + A value indicating whether the process has been terminated due to timeout or cancellation. + On Unix, the POSIX signal that terminated the process, or if the process exited normally. + Initializes a new instance of the class. To be added. @@ -58,8 +58,9 @@ System.Boolean - To be added. - To be added. + Gets a value indicating whether the process has been terminated due to timeout or cancellation. + + if the process was terminated due to timeout or cancellation; otherwise, . To be added. @@ -79,9 +80,13 @@ System.Int32 - To be added. - To be added. - To be added. + Gets the exit code of the process. + The exit code of the process. + + to get the actual signal. + ]]> + @@ -100,9 +105,13 @@ System.Nullable<System.Runtime.InteropServices.PosixSignal> - To be added. - To be added. - To be added. + Gets the POSIX signal that terminated the process on Unix, or if the process was not terminated by a signal. + The POSIX signal that terminated the process, or if the process was not terminated by a signal. + + + diff --git a/xml/System.Diagnostics/ProcessOutputLine.xml b/xml/System.Diagnostics/ProcessOutputLine.xml index a7ba3a79386..0a6411342cd 100644 --- a/xml/System.Diagnostics/ProcessOutputLine.xml +++ b/xml/System.Diagnostics/ProcessOutputLine.xml @@ -24,7 +24,7 @@ - To be added. + Represents a single line of text read from a process's standard output or standard error stream. To be added. @@ -45,9 +45,10 @@ - To be added. - To be added. - To be added. + The text content of the output line. + + if the line was read from standard error; otherwise, . + Initializes a new instance of the struct. To be added. @@ -67,8 +68,8 @@ System.String - To be added. - To be added. + Gets the text content of the output line. + The text content of the output line. To be added. @@ -88,8 +89,9 @@ System.Boolean - To be added. - To be added. + Gets a value that indicates whether the line was read from standard error. + + if the line was read from standard error; otherwise, . To be added. diff --git a/xml/System.Diagnostics/ProcessStartInfo.xml b/xml/System.Diagnostics/ProcessStartInfo.xml index 2d5592dc411..83f4a8c6cb7 100644 --- a/xml/System.Diagnostics/ProcessStartInfo.xml +++ b/xml/System.Diagnostics/ProcessStartInfo.xml @@ -196,12 +196,14 @@ - To be added. - To be added. + The name of the application or document to start. + A collection of command-line arguments to pass to the application. Initializes a new instance of the class and specifies the name of the application to start and a set of command-line arguments to pass to the application. To be added. + + or is . @@ -786,12 +788,28 @@ If you use this property to set command-line arguments, System.Collections.Generic.IList<System.Runtime.InteropServices.SafeHandle> - To be added. - To be added. - To be added. + Gets or sets a list of handles that will be inherited by the child process. + A list of objects to be explicitly inherited by the child process, or to use the default handle inheritance behavior. + + and are supported in this list. + +Setting this property on Unix systems that do not have native support for controlling handle inheritance can severely degrade process start performance. + +Handles in this list should not have inheritance enabled beforehand. If they do, they could be unintentionally inherited by other processes started concurrently with different APIs, which might lead to security or resource management issues. + +Two concurrent process starts that pass same handle in are not supported. The implementation temporarily modifies each handle's inheritance flags and this is not thread-safe across concurrent starts sharing the same handle. + +This API can't be used together with set to `true` or when specifying a user name via the property. + +On Windows, the implementation will temporarily enable inheritance on each handle in this list by modifying the handle's flags using [SetHandleInformation](https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-sethandleinformation). After the child process is created, inheritance will be unconditionally disabled on these handles to prevent them from being inherited by other processes started with different APIs. The handles themselves are not duplicated; they are made inheritable and passed to the child process. + +On Unix, the implementation will modify each file descriptor in the child process by removing the FD_CLOEXEC flag. This modification occurs after the fork and before the exec, so it does not affect the parent process. + ]]> + - - @@ -824,12 +842,21 @@ If you use this property to set command-line arguments, System.Boolean - To be added. - To be added. - To be added. + Gets or sets a value indicating whether the child process should be terminated when the parent process exits. + + to terminate the child process when the parent exits; otherwise, . The default is . + + set to `true`. + +On Windows, this is implemented using Job Objects with the [JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE](https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information) flag. + +On Linux and Android, this is implemented using `prctl(PR_SET_PDEATHSIG)`. + ]]> + - - @@ -1286,12 +1313,20 @@ You can use asynchronous read operations to avoid these dependencies and their d Microsoft.Win32.SafeHandles.SafeFileHandle - To be added. - To be added. - To be added. + Gets or sets a that will be used as the standard error of the child process. When set, the handle is passed directly to the child process and must be . + A to use as the standard error handle of the child process, or to use the default behavior. + + to create a pair of connected pipe handles, to open a file handle, to discard error output, or to inherit the parent's standard error (the default behavior when this property is `null`). + +It's recommended to dispose the handle right after starting the process. + +This property cannot be used together with and requires to be `false`. + ]]> + - - @@ -1357,12 +1392,20 @@ You can use asynchronous read operations to avoid these dependencies and their d Microsoft.Win32.SafeHandles.SafeFileHandle - To be added. - To be added. - To be added. + Gets or sets a that will be used as the standard input of the child process. When set, the handle is passed directly to the child process and must be . + A to use as the standard input handle of the child process, or to use the default behavior. + + to create a pair of connected pipe handles, to open a file handle, to provide an empty input, or to inherit the parent's standard input (the default behavior when this property is `null`). + +It's recommended to dispose the handle right after starting the process. + +This property cannot be used together with and requires to be `false`. + ]]> + - - @@ -1435,9 +1478,19 @@ You can use asynchronous read operations to avoid these dependencies and their d Microsoft.Win32.SafeHandles.SafeFileHandle - To be added. - To be added. - To be added. + Gets or sets a that will be used as the standard output of the child process. When set, the handle is passed directly to the child process and must be . + A to use as the standard output handle of the child process, or to use the default behavior. + + to create a pair of connected pipe handles, to open a file handle, to discard output, or to inherit the parent's standard output (the default behavior when this property is `null`). + +It's recommended to dispose the handle right after starting the process. + +This property cannot be used together with and requires to be `false`. + ]]> + @@ -1459,12 +1512,21 @@ You can use asynchronous read operations to avoid these dependencies and their d System.Boolean - To be added. - To be added. - To be added. + Gets or sets a value indicating whether the process should be started in a detached manner. + + to start the process detached from the parent; otherwise, . + + , , , , , or . + +On Windows, the process is started with the [DETACHED_PROCESS](https://learn.microsoft.com/windows/win32/procthread/process-creation-flags) flag. + +On Unix, the process is started as a leader of a new session. + +This property cannot be used together with set to `true`. + ]]> + - - diff --git a/xml/System.Diagnostics/ProcessTextOutput.xml b/xml/System.Diagnostics/ProcessTextOutput.xml index f5d7629713f..c0d0a41c6e9 100644 --- a/xml/System.Diagnostics/ProcessTextOutput.xml +++ b/xml/System.Diagnostics/ProcessTextOutput.xml @@ -20,7 +20,7 @@ - To be added. + Represents the captured text output and exit status of a completed process. To be added. @@ -43,12 +43,14 @@ - To be added. - To be added. - To be added. - To be added. - To be added. + The exit status of the process. + The captured standard output text. + The captured standard error text. + The process ID of the completed process. + Initializes a new instance of the class. To be added. + + , , or is . @@ -67,8 +69,8 @@ System.Diagnostics.ProcessExitStatus - To be added. - To be added. + Gets the exit status of the process. + The exit status of the process. To be added. @@ -88,8 +90,8 @@ System.Int32 - To be added. - To be added. + Gets the process ID of the completed process. + The process ID of the completed process. To be added. @@ -109,8 +111,8 @@ System.String - To be added. - To be added. + Gets the captured standard error text of the process. + The captured standard error text of the process. To be added. @@ -130,8 +132,8 @@ System.String - To be added. - To be added. + Gets the captured standard output text of the process. + The captured standard output text of the process. To be added. From de99eb96d7ce2b504cd25ba6cb5be77116d25d35 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:52:57 +0000 Subject: [PATCH 2/2] Address review feedback: fix grammar, xref encoding, and word choice --- xml/System.Diagnostics/Process.xml | 2 +- xml/System.Diagnostics/ProcessStartInfo.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xml/System.Diagnostics/Process.xml b/xml/System.Diagnostics/Process.xml index ef7cf306adc..212d205cb3e 100644 --- a/xml/System.Diagnostics/Process.xml +++ b/xml/System.Diagnostics/Process.xml @@ -5608,7 +5608,7 @@ This method is designed for fire-and-forget scenarios where the caller wants to -or- - is set to . Shell execution is not supported in fire-and-forget scenarios because on Windows it may not create a new process, making it impossible to return a valid process ID. + is set to . Shell execution is not supported in fire-and-forget scenarios because on Windows it might not create a new process, making it impossible to return a valid process ID. diff --git a/xml/System.Diagnostics/ProcessStartInfo.xml b/xml/System.Diagnostics/ProcessStartInfo.xml index 83f4a8c6cb7..ddfdbc9273e 100644 --- a/xml/System.Diagnostics/ProcessStartInfo.xml +++ b/xml/System.Diagnostics/ProcessStartInfo.xml @@ -800,7 +800,7 @@ Setting this property on Unix systems that do not have native support for contro Handles in this list should not have inheritance enabled beforehand. If they do, they could be unintentionally inherited by other processes started concurrently with different APIs, which might lead to security or resource management issues. -Two concurrent process starts that pass same handle in are not supported. The implementation temporarily modifies each handle's inheritance flags and this is not thread-safe across concurrent starts sharing the same handle. +Two concurrent process starts that pass the same handle in are not supported. The implementation temporarily modifies each handle's inheritance flags and this is not thread-safe across concurrent starts sharing the same handle. This API can't be used together with set to `true` or when specifying a user name via the property. @@ -1319,7 +1319,7 @@ You can use asynchronous read operations to avoid these dependencies and their d to create a pair of connected pipe handles, to open a file handle, to discard error output, or to inherit the parent's standard error (the default behavior when this property is `null`). +Use to create a pair of connected pipe handles, to open a file handle, to discard error output, or to inherit the parent's standard error (the default behavior when this property is `null`). It's recommended to dispose the handle right after starting the process. @@ -1398,7 +1398,7 @@ This property cannot be used together with to create a pair of connected pipe handles, to open a file handle, to provide an empty input, or to inherit the parent's standard input (the default behavior when this property is `null`). +Use to create a pair of connected pipe handles, to open a file handle, to provide an empty input, or to inherit the parent's standard input (the default behavior when this property is `null`). It's recommended to dispose the handle right after starting the process. @@ -1484,7 +1484,7 @@ This property cannot be used together with to create a pair of connected pipe handles, to open a file handle, to discard output, or to inherit the parent's standard output (the default behavior when this property is `null`). +Use to create a pair of connected pipe handles, to open a file handle, to discard output, or to inherit the parent's standard output (the default behavior when this property is `null`). It's recommended to dispose the handle right after starting the process.