Skip to content

Commit

Permalink
get SYS_gettid value specific to given architecture (and hopefully fi…
Browse files Browse the repository at this point in the history
…x the build for arm64)
  • Loading branch information
adamsitnik committed Jul 19, 2024
1 parent 0de6947 commit ee31b4e
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,23 @@ public void TestPriorityLevelProperty_Unix()
Assert.Throws<PlatformNotSupportedException>(() => thread.PriorityLevel = level);
}

private static int GetCurrentThreadId() => syscall(186); // SYS_gettid
private static int GetCurrentThreadId()

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value

Check failure on line 35 in src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs#L35

src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.Unix.cs(35,28): error CS0161: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ProcessThreadTests.GetCurrentThreadId()': not all code paths return a value
{
// The magic values come from https://github.com/torvalds/linux.
int SYS_gettid = RuntimeInformation.ProcessArchitecture switch
{
Architecture.Arm => 224,
Architecture.Arm64 => 178,
Architecture.X86 => 224,
Architecture.X64 => 186,
Architecture.S390x => 236,
Architecture.Ppc64le => 207,
Architecture.RiscV64 => 178,
_ => 178,
};

syscall(SYS_gettid);
}

[DllImport("libc")]
private static extern int syscall(int nr);
Expand Down

0 comments on commit ee31b4e

Please sign in to comment.