Skip to content

std.os.linux: Incorrect syscall numbers on x32 #23859

Open
@mpfaff

Description

@mpfaff

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 is 0x40000000) to distinguish them from x86_64 syscalls. However, the syscall numbers in the X32 enum in lib/std/os/linux/syscalls.zig are not ORed with __X32_SYSCALL_BIT. As a result, some std.os.linux functions on x32 will make x86_64 syscalls instead, and others will simply fail with ENOSYS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86bugObserved behavior contradicts documented or intended behavioros-linuxstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions