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.
Merge pull request #2974 from nguerrera/shim-pipe
Shim pipe and fcntl
- Loading branch information
Showing
17 changed files
with
230 additions
and
171 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/Common/src/Interop/Linux/libc/Interop.FcntlCommands.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/Common/src/Interop/Unix/System.Native/Interop.Fcntl.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,25 @@ | ||
// 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 static class Fcntl | ||
{ | ||
internal static readonly bool CanGetSetPipeSz = (FcntlCanGetSetPipeSz() != 0); | ||
|
||
[DllImport(Libraries.SystemNative, EntryPoint="FcntlGetPipeSz", SetLastError=true)] | ||
internal static extern int GetPipeSz(int fd); | ||
|
||
[DllImport(Libraries.SystemNative, EntryPoint="FcntlSetPipeSz", SetLastError=true)] | ||
internal static extern int SetPipeSz(int fd, int size); | ||
|
||
[DllImport(Libraries.SystemNative)] | ||
private static extern int FcntlCanGetSetPipeSz(); | ||
} | ||
} | ||
} |
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,30 @@ | ||
// 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 | ||
{ | ||
[Flags] | ||
internal enum PipeFlags | ||
{ | ||
O_CLOEXEC = 0x0010, | ||
} | ||
|
||
/// <summary> | ||
/// The index into the array filled by <see cref="pipe"/> which represents the read end of the pipe. | ||
/// </summary> | ||
internal const int ReadEndOfPipe = 0; | ||
|
||
/// <summary> | ||
/// The index into the array filled by <see cref="pipe"/> which represents the read end of the pipe. | ||
/// </summary> | ||
internal const int WriteEndOfPipe = 1; | ||
|
||
[DllImport(Libraries.SystemNative, SetLastError = true)] | ||
internal static extern unsafe int Pipe(int* pipefd, PipeFlags flags = 0); // pipefd is an array of two ints | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.