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 of sa_union.__su_sigaction #4249

Open
xingxue-ibm opened this issue Jan 23, 2025 · 0 comments
Open

[AIX] Use sa_sigaction instead of sa_union.__su_sigaction #4249

xingxue-ibm opened this issue Jan 23, 2025 · 0 comments
Labels
C-API-request Category: API request

Comments

@xingxue-ibm
Copy link

The current libc crate implementation for AIX defines the 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.

The POSIX standard defines struct sigaction as containing sa_handler and sa_sigaction members, with their storage allowed to overlap. Other operating systems, such as Linux, also define a union for sa_handler and sa_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 is because the storage of sa_handler and sa_sigaction overlaps, and only sa_sigaction is typically referenced in Rust.

We propose modifying the libc crate implementation for AIX to define sa_sigaction as a direct member of struct sigaction, aligning it with implementations for other platforms. We will also update affected crates and test cases to reflect this change.

target=powerpc64-ibm-aix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

No branches or pull requests

1 participant