Search code examples
linuxlinux-kernelsystem-callsltrace

Importance of Kernel level system calls for fork, vfork


When tracing system calls with ltrace for programs with fork, vfork ... it shows to call SYS_Clone system call. Then what is the importance of the SYS_fork, SYS_vfork system call in the kernel. They are for historical purpose?


Solution

  • They have to be maintained in the kernel because old userspace programs (either old versions of libc or old statically-linked binaries) call these system calls rather than the newer clone. The Linux kernel maintains backwards-compatibility in the ABI.

    If a new architecture is added to the Linux kernel, it doesn't have to support those obsolete system calls, because there can be no old userspace for that architecture. So you'll find, for example, that the ia64 architecture doesn't have a SYS_fork call.