Skip to content
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

[AIX] Use sa_sigaction instead the union #4250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xingxue-ibm
Copy link

Description

The current libc crate implementation for AIX defines struct sigaction as containing a union sa_union with two members: __su_handler and __su_sigaction. This mirrors the struct sigaction definition in the AIX system header. Consequently, any reference to sa_sigaction in Rust code, whether in shipped crates or user code, must be replaced with sa_union.__su_sigaction for AIX. Additionally, the types of these two union members are declared as function pointers rather than sighandler_t (i.e., usize), as is the case on other platforms. This discrepancy causes compiler errors when sighandler_t is used as the type for signal handlers. Other operating systems, such as Linux, also define a union for sa_handler and sa_sigaction in struct sigaction. However, the libc crate implementations on these platforms define sa_sigaction directly as a member of struct sigaction rather than as part of a union. This patch modifies the libc crate implementation for AIX to define sa_sigaction as a direct member of struct sigaction, aligning it with implementations for other similar platforms. We will also update affected crates and test cases to reflect this change.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@xingxue-ibm
Copy link
Author

close GH-4249

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

Successfully merging this pull request may close these issues.

3 participants