fuz
fuz

Reputation: 93127

Why are the system call numbers different in amd64 linux?

I noticed that the x86 int $0x80 and the amd64 syscall system calls have different numbers. For instance, sys_exit is syscall 1 in x86 and syscall 60 in amd64. Is there a (historical) reason for the different system call numbering schemes?

Upvotes: 15

Views: 1733

Answers (1)

user1202136
user1202136

Reputation: 11567

The syscall interface is supposed to be very stable and only additions are allowed. Talking advantage of the fact that the syscall interface is different for each architecture, the Linux guys most likely decided to clean up some accumulated cruft and start the amd64 syscalls from scratch.

Reference: linux/Documentation/ABI/stable/syscalls

This interface matches much of the POSIX interface and is based on it and other Unix based interfaces. It will only be added to over time, and not have things removed from it.

Note that this interface is different for every architecture that Linux supports. Please see the architecture-specific documentation for details on the syscall numbers that are to be mapped to each syscall.

Upvotes: 16

Related Questions