File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
src/libraries/System.Diagnostics.Process/tests Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,23 @@ public void TestPriorityLevelProperty_Unix()
32
32
Assert . Throws < PlatformNotSupportedException > ( ( ) => thread . PriorityLevel = level ) ;
33
33
}
34
34
35
- private static int GetCurrentThreadId ( ) => syscall ( 186 ) ; // SYS_gettid
35
+ private static int GetCurrentThreadId ( )
36
+ {
37
+ // The magic values come from https://github.com/torvalds/linux.
38
+ int SYS_gettid = RuntimeInformation . ProcessArchitecture switch
39
+ {
40
+ Architecture . Arm => 224 ,
41
+ Architecture . Arm64 => 178 ,
42
+ Architecture . X86 => 224 ,
43
+ Architecture . X64 => 186 ,
44
+ Architecture . S390x => 236 ,
45
+ Architecture . Ppc64le => 207 ,
46
+ Architecture . RiscV64 => 178 ,
47
+ _ => 178 ,
48
+ } ;
49
+
50
+ return syscall ( SYS_gettid ) ;
51
+ }
36
52
37
53
[ DllImport ( "libc" ) ]
38
54
private static extern int syscall ( int nr ) ;
You can’t perform that action at this time.
0 commit comments