-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Consolidate CMSG_* implementations #4908
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
Open
gibbz00
wants to merge
1
commit into
rust-lang:main
Choose a base branch
from
gibbz00:consolidate_cmsg_next
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| //! Directory: `sys/` | ||
|
|
||
| pub(crate) mod socket; |
This file contains hidden or 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,9 @@ | ||
| //! Header: `sys/socket.h` | ||
|
|
||
| pub use crate::new::common::posix::sys::socket::{ | ||
| CMSG_DATA, | ||
| CMSG_FIRSTHDR, | ||
| CMSG_LEN, | ||
| CMSG_NXTHDR, | ||
| CMSG_SPACE, | ||
| }; |
This file contains hidden or 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,6 @@ | ||
| //! Entrypoint for Apple headers, usually found as part of the Xcode SDK. | ||
| //! | ||
| //! <https://github.com/apple-oss-distributions/Libc/tree/main/include> | ||
|
|
||
| pub(crate) mod signal; | ||
| pub(crate) mod unistd; |
This file contains hidden or 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 hidden or 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 hidden or 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,11 @@ | ||
| //! Header: `sys/socket.h` | ||
| //! | ||
| //! <https://github.com/apple-oss-distributions/xnu/blob/main/bsd/sys/socket.h> | ||
|
|
||
| pub use crate::new::common::bsd::sys::socket::CMSG_NXTHDR; | ||
| pub use crate::new::common::posix::sys::socket::{ | ||
| CMSG_DATA, | ||
| CMSG_FIRSTHDR, | ||
| CMSG_LEN, | ||
| CMSG_SPACE, | ||
| }; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| //! Interfaces common across the BSD family. | ||
|
|
||
| pub(crate) mod sys; |
This file contains hidden or 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 @@ | ||
| pub(crate) mod socket; |
This file contains hidden or 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,11 @@ | ||
| #[cfg(not(target_os = "dragonfly"))] | ||
| pub unsafe fn CMSG_NXTHDR( | ||
| mhdr: *const crate::msghdr, | ||
| cmsg: *const crate::cmsghdr, | ||
| ) -> *mut crate::cmsghdr { | ||
| if cmsg.is_null() { | ||
| return crate::CMSG_FIRSTHDR(mhdr); | ||
| } | ||
|
|
||
| crate::new::common::posix::sys::socket::CMSG_NXTHDR(mhdr, cmsg) | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ | |
| ))] | ||
| pub(crate) mod pthread; | ||
| pub(crate) mod unistd; | ||
|
|
||
| pub(crate) mod sys; | ||
This file contains hidden or 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,3 @@ | ||
| //! Directory: `sys/` | ||
|
|
||
| pub(crate) mod socket; |
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.
Is this one actually getting picked up? The module is defined here
libc/src/new/apple/mod.rs
Lines 9 to 12 in ab195eb
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.
There's a
pub(crate) use libc::*;a bit further down :)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.
Hah, see what you mean. I seem to have made it into a
mod.rswhilst keeping themod libc {}somehow. I probably did when adding alibc/sys/socket.rs, realizing later on that it should be underxnu/, (hence the out-of-place freebsd copy-pasta).Anyhow, I've now removed the
libc/sys/socket.rs, making themod.rscreation irrelevant to this PR... Do you want med to keep it anyway?