Skip to content

Commit

Permalink
Add remark about Unix for SetEnvironmentVariable
Browse files Browse the repository at this point in the history
In regard to dotnet/runtime#9529
  • Loading branch information
parched authored Aug 15, 2022
1 parent 92880d5 commit 8bab2de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xml/System/Environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,8 @@ If the executable is renamed or deleted before this property is first accessed,
## Remarks
Calling this method is equivalent to calling the <xref:System.Environment.SetEnvironmentVariable%28System.String%2CSystem.String%2CSystem.EnvironmentVariableTarget%29> overload with a value of <xref:System.EnvironmentVariableTarget.Process?displayProperty=nameWithType> for the `target` argument.
On .NET on macOS and Linux systems, calls to the <xref:System.Environment.SetEnvironmentVariable%28System.String%2CSystem.String%29> method have no effect on any native libraries that are, or will be, loaded.
If the `value` argument is not empty (see the discussion of deleting an environment variable later in this section for the definition of an empty value) and the environment variable named by the `variable` parameter does not exist, the environment variable is created and assigned the contents of `value`. If it does exist, its value is modified. Because the environment variable is defined in the environment block of the current process only, it does not persist after the process has ended.
If `variable` contains a non-initial hexadecimal zero character, the characters before the zero character are considered the environment variable name and all subsequent characters are ignored.
Expand Down Expand Up @@ -2033,6 +2035,8 @@ In addition, on Windows systems only, the <xref:System.Environment.SetEnvironmen
On .NET on macOS and Linux systems, calls to the <xref:System.Environment.SetEnvironmentVariable%28System.String%2CSystem.String%2CSystem.EnvironmentVariableTarget%29> method with a value of <xref:System.EnvironmentVariableTarget.Machine?displayProperty=nameWithType> or <xref:System.EnvironmentVariableTarget.User?displayProperty=nameWithType> are ignored.
On .NET on macOS and Linux systems, calls to the <xref:System.Environment.SetEnvironmentVariable%28System.String%2CSystem.String%2CSystem.EnvironmentVariableTarget%29> method with a value of <xref:System.EnvironmentVariableTarget.Process?displayProperty=nameWithType> have no effect on any native libraries that are, or will be, loaded.
If the `value` argument is not empty (see the discussion of deleting an environment variable later in this section for the definition of an empty value) and the environment variable named by the `variable` argument does not exist, the environment variable is created and assigned the contents of `value`. If it does exist, its value is modified.
If `variable` contains a non-initial hexadecimal zero character, the characters before the zero character are considered the environment variable name and all subsequent characters are ignored.
Expand Down

0 comments on commit 8bab2de

Please sign in to comment.