Of the above, 5 are obsolete, namely oldfstat, oldlstat,
oldolduname, oldstat and olduname (see also obsolete(2)),
and 11 are unimplemented, namely afs_syscall, break, ftime,
gtty, lock, mpx, phys, prof, profil, stty and ulimit (see
also unimplemented(2)). However, ftime(3), profil(3) and
ulimit(3) exist as library routines. The slot for phys is in
use since 2.1.116 for umount2; phys will never be
implemented.

Roughly speaking, the code belonging to the system call with
number __NR_xxx defined in /usr/include/asm/unistd.h
can be found in the kernel source in the routine
sys_xxx(). (The dispatch table for i386 can be found
in /usr/src/linux/arch/i386/kernel/entry.S.) There
are many exceptions, however, mostly because older system
calls were superseded by newer ones, and this has been
treated somewhat unsystematically. Below the details for
Linux 2.0.34.

The defines NR_oldstat and NR_stat refer to the routines
sys_stat() and sys_newstat(), and similarly for fstat
and lstat. Similarly, the defines NR_oldolduname,
NR_olduname and NR_uname refer to the routines
sys_olduname(), sys_uname() and sys_newuname(). Thus,
NR_stat and __NR_uname have always referred to the latest
version of the system call, and the older ones are for
backward compatibility.

It is different with select and mmap. These
use five or more parameters, and caused problems the way
parameter passing on the i386 used to be set up. Thus, while
other architectures have sys_select() ans sys_mmap()
corresponding to NR_select and NR_mmap, on i386 one
finds old_select() and old_mmap() (routines that use a
pointer to a parameter block) instead. These days passing
five parameters is not a problem anymore, and there is a
NRnewselect (used by libc 6) that corresponds directly
to sys_select().

Two other system call numbers, NRllseek and NRsysctl
have an additional underscore absent in sys_llseek() and
sys_sysctl().

Then there is __NR_readdir corresponding to old_readdir(),
which will read at most one directory entry at a time, and
is superseded by sys_getdents().

Finally, the system call 166, with entry point sys_vm86()
does not have a symbolic number at all. This version
supersedes sys_vm86old() with number __NR_vm86.

Please note that any user can change the contents of pages on this site,
and therefore the Waikato Linux Users Group can offer no assurances that
the information is correct, and the information on this site is not
necessarily the opinion of the Waikato Linux Users Group, or any of its
members. If you have any complaints about the contents of this page,
please do not hesitate to contact the Waikato Linux Users Group, or, click
the Edit button!

Unless otherwise noted, all pages on this site are licensed under the
WlugWikiLicense.