[阅读: 775] 2005-12-14 02:36:50
clone creates a new process, just like fork(2). clone is a library
function layered on top of the underlying clone system call, here-
inafter referred to as sys_clone. A description of sys_clone is given
towards the end of this page.
Unlike fork(2), these calls allow the child process to share parts of
its execution context with the calling process, such as the memory
space, the table of file descriptors, and the table of signal handlers.
(Note that on this manual page, "calling process" normally corresponds
to "parent process". But see the description of CLONE_PARENT below.)
The main use of clone is to implement threads: multiple threads of con-
trol in a program that run concurrently in a shared memory space.