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?
Asked
Active
Viewed 663 times
3
-
1`sys_clone` is the older function. `sys_fork` and `sys_vfork` were added in Linux 2.2. Internally all three use `do_fork()`. – Roland Jansen Aug 17 '13 at 06:11
-
1I have used it on Linux 3.2 – user567879 Aug 17 '13 at 08:14
-
http://stackoverflow.com/questions/4856255/the-difference-between-fork-vfork-exec-and-clone – Roland Jansen Aug 17 '13 at 08:16
1 Answers
4
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.

caf
- 233,326
- 40
- 323
- 462