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
Conversation
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
internal static extern unsafe int FcntlGetPipeSz(int fd); | ||
|
||
[DllImport(Libraries.SystemNative)] | ||
internal static extern unsafe int FcntlSetPipeSz(int fd, int size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should all of these methods instead be on the Fcntl type, e.g. Interop.Sys.Fcntl.GetPipeSz(fd)
?
Nice. I really like how this cleans things up, and I agree with the direction. A few comments, and otherwise LGTM. |
nguerrera
force-pushed
the
shim-pipe
branch
2 times, most recently
from
August 26, 2015 18:54
c80e7f3
to
d611b57
Compare
return fcntl(fd, F_SETPIPE_SZ, size); | ||
#else | ||
errno = ENOTSUP; | ||
return -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, build failed due to lack of a semicolon ending this line.
@stephentoub I think I've addressed everything and CI is green. Let me know if there's anything else. |
Looks great. |
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
Shim pipe and fcntl Commit migrated from dotnet/corefx@86d077f
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add shims for pipe and fcntl.
Move the ignore of inheritability / O_CLOEXEC down to the shim.
Add a capability API for fcntl F_GET/SETPIPE_SZ. Originally, I was going to use errno = ENOTSUP alone, but the current behavior requires making a call in some cases before we even have a handle to invoke fcntl.
I went back and forth on how to shim fcntl, but decided on separate functions for each command (with just those that we use shimed for now. It's easier to reason about as the command effectively have different signatures and we lose strong typing if we mirror the '...' varargs of the native API. It also eliminates the complexity of converting the command code.
With this change, System.IO.Pipes can now have one build for all Unix targets.