logoalt Hacker News

bkallus • today at 11:49 AM • 1 reply • view on HN

On x86_64 and x32, the syscall number goes in eax, not rax. The upper 32 bits of rax are ignored and can be anything.


Replies

guitmz • today at 12:00 PM

Good catch, thanks! Since 5.14 (I think?) the kernel only reads eax (before that it used all of rax and returned ENOSYS if the upper half wasn't zero), so I'm adding a note about it to the x64 and x32 conventions

➕ show 1 reply