Connecting Tech Pros Worldwide Forums | Help | Site Map

how to use clone()

Newbie
 
Join Date: Oct 2008
Posts: 2
#1: Oct 2 '08
I want to write a function using clone() to generate a simple process, which just need to print some information about the process, for example, pid of the parent process and pid of the child process..

arne's Avatar
Expert
 
Join Date: Oct 2006
Posts: 306
#2: Oct 5 '08

re: how to use clone()


If we're talking C here, have a look at the functions fork(), getpid() and getppid().

HTH,
Arne
Newbie
 
Join Date: Oct 2008
Posts: 2
#3: Oct 5 '08

re: how to use clone()


i could only use clone() to create a process, professor gave this homework... there are few information or examples about clone()..
arne's Avatar
Expert
 
Join Date: Oct 2006
Posts: 306
#4: Oct 6 '08

re: how to use clone()


Quote:

Originally Posted by kid420

i could only use clone() to create a process, professor gave this homework... there are few information or examples about clone()..

Well, here is an article from the Linux Journal.

This and 'man clone' should help.

Cheers,
arne
Reply