-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std.os.linux: Incorrect syscall numbers on x32 #23859
Copy link
Copy link
Closed
Labels
abi-ilp32The 32-bit ABI for various 64-bit architecturesThe 32-bit ABI for various 64-bit architecturesarch-x86_6464-bit x8664-bit x86bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-linuxLinuxLinuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
abi-ilp32The 32-bit ABI for various 64-bit architecturesThe 32-bit ABI for various 64-bit architecturesarch-x86_6464-bit x8664-bit x86bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-linuxLinuxLinuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Zig Version
0.15.0-dev.483+837e0f9c3
According to the syscall man page, the x32 ABI requires that the syscall numbers be ORed with
__X32_SYSCALL_BIT(which is0x40000000) to distinguish them from x86_64 syscalls. However, the syscall numbers in theX32enum inlib/std/os/linux/syscalls.zigare not ORed with__X32_SYSCALL_BIT. As a result, somestd.os.linuxfunctions on x32 will make x86_64 syscalls instead, and others will simply fail withENOSYS.