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.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but could you please add a changelog entry?

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.
@batkovic75 batkovic75 force-pushed the fix-uclibc-signal-flags branch from 5fa15dc to b5a1db1 Compare October 7, 2025 16:04
@batkovic75
Copy link
Author

Sure, I added changelog/2671.fixed.md changelog entry following doc at CONTRIBUTING.md#pull-requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants