forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet/corefx#3798 from sokket/shim
Shim'ing out the processor affinity function calls for the Linux kernel Commit migrated from dotnet/corefx@7691049
- Loading branch information
Showing
8 changed files
with
160 additions
and
56 deletions.
There are no files selected for viewing
48 changes: 0 additions & 48 deletions
48
src/libraries/Common/src/Interop/Linux/libc/Interop.sched_getsetaffinity.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Sys | ||
{ | ||
internal unsafe struct CpuSetBits | ||
{ | ||
private fixed ulong Bits[16]; | ||
} | ||
|
||
[DllImport(Libraries.SystemNative, SetLastError = true)] | ||
internal static extern int SchedSetAffinity(int pid, ref CpuSetBits mask); | ||
|
||
[DllImport(Libraries.SystemNative, SetLastError = true)] | ||
internal static extern int SchedGetAffinity(int pid, out CpuSetBits mask); | ||
|
||
[DllImport(Libraries.SystemNative)] | ||
internal static extern void CpuSet(int cpu, ref CpuSetBits set); | ||
|
||
[DllImport(Libraries.SystemNative)] | ||
internal static extern bool CpuIsSet(int cpu, ref CpuSetBits set); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters