1

Are the numbers for the system calls for every machine different? Does it depend on the processor, I mean will there be a difference for i586 and i386?

If they are different for every machine, how can you find out the numbers for your machine?

One common place is /usr/include/asm*, but this folder does not exist.

  • If you're missing /usr/include/asm, you might be missing some devel package or other. For me (Fedora 22) it's in either kernel-devel or kernel-headers, and the file is /usr/include/asm/unistd_64.h. Presumably the same file is also in the kernel source tree somewhere, if you look. – Tom Hunt Nov 30 '15 at 18:15
-2

On most OS, the numbers are in /usr/include/sys/syscall.h

You usually can call syscall(number, rest of parameters).

Note that some "syscalls" may not be in syscalls.h as several syscall interfaces are implemented by a single syscall that uses a sub-number for selecting on call from a group of calls.

The syscall numbers are only valid for a specific version of a specific OS.

On Solaris, there is no stable syscall interface but a stable interface above libc. This is fully POSIX compliant as POSIX intentionally does not distinct between syscalls and library functions.

  • The problem is there is no include folder at all. Are the numbers for every i586 machine the same? Is there any resource for i586 mentioning all the numbers? – Joey Nov 30 '15 at 18:35
  • 1
    @Joey The number of system calls depends on the kernel version and on compilation options. If the headers aren't there, install them. – Gilles Nov 30 '15 at 22:48
  • @Gilles How can you install them? – Joey Dec 1 '15 at 10:19
  • Compilation options are a relict from the 1980s, a modern OS autoconfigures at runtime and auto-loads all requested modules that are available in the kernels search PATH. – schily Dec 1 '15 at 10:34
  • 1
    @Joey With your distribution's package manager. For example, on Ubuntu, kernels are provided by packages linux-image-XXX and the headers needed to compile additional modules are in linux-headers-XXX. – Gilles Dec 1 '15 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.