Wikipedia:

clone

(Linux system call)

clone() is a system call on the Linux kernel related to multithreading.

The syntax for calling clone under a Linux program is:

#include <sched.h>
int clone (int (*fn) (void *), void *child_stack, int flags, void *arg);

clone creates a new thread that starts with function pointed to by the fn argument (as opposed to fork() which continues with the next command after fork().) The child_stack argument is a pointer to a memory space to be used as the stack for the new thread (which must be malloc'ed before that; on most architectures stack grows down, so the pointer should point at the end of the space), flags specify what gets inherited from the parent process, and arg is the argument passed to the function. It returns the process ID of the child process or -1 on failure.


 
 
 

Join the WikiAnswers Q&A community. Post a question or answer questions about "clone" at WikiAnswers.

 

Copyrights:

Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Clone (Linux system call)" Read more

Search for answers directly from your browser with the FREE Answers.com Toolbar!  
Click here to download now. 

Get Answers your way! Check out all our free tools and products.

On this page:   E-mail   print Print  Link  

 

Keep Reading

Mentioned In: