Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: add uclibc MIPS signal flags compatibility #2671

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

Open
batkovic75 wants to merge 1 commit into nix-rust:master
base: master
Choose a base branch
Loading
from batkovic75:fix-uclibc-signal-flags

Conversation

@batkovic75
Copy link

@batkovic75 batkovic75 commented Sep 3, 2025

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?

batkovic75 reacted with thumbs up emoji
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.
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

Reviewers

@asomers asomers asomers requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /