-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kmc-solid: I/O safety #115159
Merged
Merged
kmc-solid: I/O safety #115159
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5d3aefe
kmc-solid: Add `std::os::solid::io::{BorrowedFd,OwnedFd,AsFd}`
kawadakk ddfe168
kmc-solid: Document I/O safety in `std::os::solid::io`
kawadakk cf9c4a3
kmc-solid: Implement `AsFd` and conversion to/from `OwnedFd` for `{Tc…
kawadakk 0dd3b25
kmc-solid: Implement `AsFd` for `{Arc,Rc,Box}<impl AsFd>`
kawadakk cbfab81
kmc-solid: Replace `{From,Into}Inner<c_int>` impls with `*RawFd` for …
kawadakk 6d1e4dd
kmc-solid: Remove `FileDesc`
kawadakk 46bc247
kmc-solid: Implement `{From,Into}Inner<OwnedFd>` for `Socket`
kawadakk c8c3339
kmc-solid: Reimplement `AsFd` etc for `{TcpStream,TcpListener,UdpSock…
kawadakk 52eb92d
kmc-solid: Re-export `{As,Borrowed,Owned}Fd` in `std::os::solid::prel…
kawadakk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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.
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.
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.
This layout optimization has come into question on Haiku:
BorrowedFd
layout optimization on Haiku #112371I would appreciate it if you weighed in with your thoughts, either here or in that PR.
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.
This
BorrowedFd
is specific to the SOLID socket subsystem, so technically it's closer tostd::os::windows::io::BorrowedSocket
thanstd::os::fd::BorrowedFd
, the POSIX file descriptor that is in question in the referred issue.Personally,
AT_FDCWD
feels like a special value that can only be handled by a few supported functions. It's also unusual in that it doesn't point to one static entity over its lifetime, which I suspect may break assumption of some code. I'd be fine withfd::BorrowedFd
only being able to hold a "valid" value and leaving the ability to hold such special values unspecified.Even the POSIX specification's wordings suggest that it's not a file descriptor:
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.
oh, interesting! I hadn't realized that SOLID was that divergent!