Skip to content

Commit

Permalink
Work around long socket path on tvOS.
Browse files Browse the repository at this point in the history
tvOS has a MAX_PATH of 104 characters on domain sockets, and a 90 character
value for GetTempPath. That gives us only 14 characters to play with, and
temp filenames are 12 characters long. We cannot afford the `CoreFxPipe_`
prefix on tvOS, with our tiny character path budget.

Check whether this fixes some or all of dotnet#67853 and dotnet#51390 too.
  • Loading branch information
directhex committed Aug 3, 2022
1 parent 272f9c9 commit c8c1eb3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract partial class PipeStream : Stream
private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars();

/// <summary>Prefix to prepend to all pipe names.</summary>
private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_");
private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), (RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS"))) ? "" : "CoreFxPipe_");

public override int Read(byte[] buffer, int offset, int count)
{
Expand Down

0 comments on commit c8c1eb3

Please sign in to comment.