Skip to content

Linux Raw: Clarify x86_64 linux_raw syscall number. #687

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

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

briansmith
Copy link
Contributor

The source code didn't mention the x32 ABI by name. Give __X32_SYSCALL_BIT its rightful name so readers can understand what we're doing. Explain why we're not using cfg(target_abi).

For other ILP32 ABIs, it seems like they use the same syscall numbers.

// TODO(MSRV-1.78): Add `any(target_abi = "", target_abi = "x32")` above.
const __X32_SYSCALL_BIT: u32 = 1 << 30;
#[allow(clippy::assertions_on_constants)]
const _MATCHES_KERNEL_SOURCE: () = assert!(__X32_SYSCALL_BIT == 0x40000000);
Copy link
Member

Choose a reason for hiding this comment

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

Why not just write it as const __X32_SYSCALL_BIT: u32 = 0x40000000; ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not just write it as const __X32_SYSCALL_BIT: u32 = 0x40000000; ?

Done!

The source code didn't mention the x32 ABI by name. Give
`__X32_SYSCALL_BIT` its rightful name so readers can understand
what we're doing. Explain why we're not using `cfg(target_abi)`.

For other ILP32 ABIs, it seems like they use the same syscall
numbers.
@newpavlov newpavlov merged commit e500436 into rust-random:master Jun 9, 2025
74 checks passed
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.

2 participants