Skip to content

Missing SIOC ioctl constants on MacOS #3626

Open
@relativityspace-jsmith

Description

@relativityspace-jsmith

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-API-requestCategory: API requestE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions