Skip to content
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

Missing SIOC ioctl constants on MacOS #3626

Open
relativityspace-jsmith opened this issue Mar 19, 2024 · 0 comments · May be fixed by #3838
Open

Missing SIOC ioctl constants on MacOS #3626

relativityspace-jsmith opened this issue Mar 19, 2024 · 0 comments · May be fixed by #3838
Labels
C-API-request Category: API request E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@relativityspace-jsmith
Copy link

Target Triple: aarch64-apple-darwin

Hi, I was able to use the SIOCGIFFLAGS ioctl (with the libc::ifreq struct) just fine on Linux, but on Mac, I hit an issue due to the SIOCGIFFLAGS constant not being defined. It looks like all of the ioctl constants from sys/sockio.h are missing.

For now I was able to use this workaround:

#[cfg(any(target_os = "ios", target_os = "macos"))]
const SIOCGIFFLAGS: libc::c_ulong = 0xc0206911; // extracted from macos headers via printing it in a C program

#[cfg(not(any(target_os = "ios", target_os = "macos")))]
const SIOCGIFFLAGS: libc::c_ulong = libc::SIOCGIFFLAGS;
@relativityspace-jsmith relativityspace-jsmith added the C-API-request Category: API request label Mar 19, 2024
@tgross35 tgross35 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. and removed help wanted labels Aug 29, 2024
@tgross35 tgross35 added this to the 1.x milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants