i386 vs. x86_64 linux system calls
Monday, August 7th, 2006
Probably old news, but linux made some changes to the way you performs system calls under the x86_64 architecture. It used to be that you could call interrupt 0×80, but this has changed. It seems you can still call via an interrupt, but you can’t use the syscall numbers provided by asm/unistd.h as they have all been changed. The new and faster method is to use the SYSCALL operation. The semantics are slightly different, eax still holds the syscall number, but the argument list is reversed.
For example, on i386:
Error: Could not open i386_syscall.c
would become this on x86_64:
Error: Could not open x86_64_syscall.c