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
Open

Missing SIOC ioctl constants on MacOS #3626

relativityspace-jsmith opened this issue Mar 19, 2024 · 0 comments
Labels
C-API-request Category: API request

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
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
Projects
None yet
Development

No branches or pull requests

1 participant