Skip to content

Commit

Permalink
Add support for musl (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke committed Mar 4, 2024
1 parent dd85c97 commit 6ac2e08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ jobs:
- TARGET: "x86_64-unknown-linux-gnu"
<<: *target_steps_std

target-x86_64-unknown-linux-musl:
resource_class: large
environment:
- TARGET: "x86_64-unknown-linux-musl"
<<: *target_steps_std

miri-x86_64-unknown-linux-gnu:
resource_class: large
environment:
Expand Down Expand Up @@ -181,6 +187,7 @@ jobs:
build_jobs: &build_jobs
jobs:
- target-x86_64-unknown-linux-gnu
- target-x86_64-unknown-linux-musl
- miri-x86_64-unknown-linux-gnu
- windows-cross
- macos-cross
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ An EtherCAT master written in Rust.
matching on CoE transfer errors.
- [#169](https://github.com/ethercrab-rs/ethercrab/pull/169) Linux only: add `io_uring`-based
blocking TX/RX loop for better performance.
- [#173](https://github.com/ethercrab-rs/ethercrab/pull/173) Add MUSL libc support.

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions src/std/unix/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ fn ifreq_ioctl(
) -> io::Result<libc::c_int> {
unsafe {
#[allow(trivial_casts)]
#[cfg(target_env = "musl")]
let res = libc::ioctl(lower, cmd as libc::c_int, ifreq as *mut ifreq);
#[allow(trivial_casts)]
#[cfg(not(target_env = "musl"))]
let res = libc::ioctl(lower, cmd, ifreq as *mut ifreq);

if res == -1 {
Expand Down

0 comments on commit 6ac2e08

Please sign in to comment.