Re: Same syscall is defined to different numbers on 3 different archs(was Re: Makefile issue)

From

Andi Kleen <>

Date

07 Apr 2003 17:54:39 +0200

"Robert Williamson" <robbiew@us.ibm.com> writes:> > Obviously, we could add additional code to check for the running arch and> define the syscall accordingly, however I'm not sure this is the correct> way to go. I'm copying our list, as well as the kernel mailing list about> this, because I "think" the system calls should be defined to the same> numbers across all architectures....but I'm not positive. BTW, I attached

No. Linux has traditionally used different syscall numbers for differentarchitectures. The original ports (alpha etc.) always used the syscall numbersof the "native" Unix, so the numbering was often completely different.Newer ports who weren't concered about such compatibility often did a renumbering too. For example x86-64 has a completely new "cache line optimized" ordering.

What should work on most architectures is (most = someone told me it doesn't work properly on IA64)

#include </path/to/kernel/source/include/asm-<arch>/unistd.h>(you need the version in the kernel source because many glibc packagersin their infinite wisdom use an old outdated copy of asm/ usually fromthe last stable kernel only)