This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shim'ing out the processor affinity function calls for the Linux kernel
- Loading branch information
Jonathan Miller
committed
Oct 13, 2015
1 parent
708c8e5
commit 8c6587f
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/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/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