-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add missing sysctl net types for mac #4022
Conversation
r? @JohnTitor rustbot has assigned @JohnTitor. Use |
Ah I see, the |
9424e40
to
75d537c
Compare
And implemented traits on the new types as well. |
CI passed. \o/ |
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.
One cleanup suggestion but otherwise lgtm. Also added source links to the PR description.
@rustbot label +stable-nominated
src/unix/bsd/apple/mod.rs
Outdated
@@ -1580,6 +1580,50 @@ s_no_extra_traits! { | |||
pub ifr_name: [::c_char; ::IFNAMSIZ], | |||
pub ifr_ifru: __c_anonymous_ifr_ifru6, | |||
} | |||
|
|||
pub struct ifmibdata { |
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.
Could these just go in s!
rather than s_no_extra_traits!
so the trait implementations don't need to be handwritten?
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.
Ah I was wondering why I needed to implement these traits myself. Completely forgot about the macro... ^^'
75d537c
to
5a2cd1c
Compare
5a2cd1c
to
f444670
Compare
f444670
to
1bcda05
Compare
Not sure to understand why linux is failing considering I didn't change linux's code... Weird |
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.
Yeah the CI failure is unrelated rust-lang/rust#133035, I'll merge after the next nightly drops.
(backport <rust-lang#4022>) (cherry picked from commit 57a1be4)
(backport <rust-lang#4022>) (cherry picked from commit 1bcda05)
Hey @GuillaumeGomez where did the definition for |
It's the second header: https://fergofrog.com/code/codebrowser/xnu/bsd/net/if_mib.h.html#if_family_id |
I know that site shows it, but where does that site's source come from? It's not in the official xnu repo |
Absolutely no clue. Seems to be a common header for BSD-based systems from what I can understand. It's horribly difficult to find apple's headers. When I tested locally on my (2015) macbook, there was no issue so I assumed it was the right definition. |
Mine is a bit newer, I have the header but I don't have that specific struct (matches xnu). Maybe it existed at some point but was removed? For reference
It's not a problem to have if they're useful, just wondering if there is a test config that should be set so mine don't fail :) |
Ah. If it was removed then we have a big issue. OS versions don't mix well at all with APIs. |
It looks like CI has the macOS 14.5 SDKs, so I'm going to guess that it isn't available in the newest APIs. Did you need |
I don't need it so go ahead. :) |
This API appears to not be available in more recent MacOS SDKs, and there aren't any functions that use it. Since this hasn't yet made it into a release, remove it. Link: rust-lang#4022
This API appears to not be available in more recent MacOS SDKs, and there aren't any functions that use it. Since this hasn't yet made it into a release, remove it. Link: rust-lang#4022 (backport <rust-lang#4137>) (cherry picked from commit e87acba)
This API appears to not be available in more recent MacOS SDKs, and there aren't any functions that use it. Since this hasn't yet made it into a release, remove it. Link: rust-lang#4022 (backport <rust-lang#4137>) (cherry picked from commit e87acba)
This API appears to not be available in more recent MacOS SDKs, and there aren't any functions that use it. Since this hasn't yet made it into a release, remove it. Link: rust-lang#4022 (backport <rust-lang#4137>) (cherry picked from commit e87acba)
This API appears to not be available in more recent MacOS SDKs, and there aren't any functions that use it. Since this hasn't yet made it into a release, remove it. Link: rust-lang#4022 (backport <rust-lang#4137>) (cherry picked from commit e87acba)
Thanks to GuillaumeGomez/sysinfo#1378, I discovered that mac's API was actually 32 bits for network information, even if it's not obvious. To go around this limitation, we need to use a different kind of
sysctl
value andstruct
. Adding them here.Sources