Skip to content

Conversation

batkovic75
Copy link

I open this PR to fix signal handling compatibility for MIPS uclibc systems by addressing type mismatches in sa_flags.

MIPS uclibc (version 0.9.x series that can be found on some embedded devices) defines sa_flags as unsigned int instead of the standard int, causing compilation failures when building nix on these systems.

Changes

  • Add conditional compilation in src/sys/signal.rs to use libc::c_uint for SaFlags_t type on MIPS with uclibc
  • Add explicit cast in libc_bitflags! macro for MIPS uclibc compatibility
  • Maintains backward compatibility with all other platforms (no changes to existing behavior)

Testing

  • Verified compilation succeeds with MIPS (mipsel) uClibc 0.9.33 / GCC 4.9 toolchain
  • Confirmed no impact on other platforms (conditional compilation only affects MIPS+uclibc)
  • Follow existing codebase patterns (similar to src/sys/statfs.rs uclibc handling)

Note: No API changes, this is purely a compatibility fix for existing signal handling functionality. The public
API remains identical on all platforms.

MIPS uclibc defines sa_flags as unsigned int instead of int, causing
type mismatches. This adds conditional compilation to use the correct
type (c_uint) for MIPS uclibc while maintaining compatibility with
other platforms.

Fixes signal handling on old uclibc systems (0.9.x series) commonly
found on embedded MIPS devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant