answersLogoWhite

0

Fork : The fork call basically makes a duplicate of the current process, identical in almost every way (not everything is copied over, for example, resource limits in some implementations but the idea is to create as close a copy as possible).

The new process (child) gets a different process ID (PID) and has the the PID of the old process (parent) as its parent PID (PPID). Because the two processes are now running exactly the same code, they can tell which is which by the return code of fork - the child gets 0, the parent gets the PID of the child. This is all, of course, assuming the fork call works - if not, no child is created and the parent gets an error code.

Clone : Clone, as fork, creates a new process. Unlike fork, 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.

When the child process is created with clone, it executes the function application fn(arg). (This differs from for, where execution continues in the child from the point of the fork call.) The fn argument is a pointer to a function that is called by the child process at the beginning of its execution. The arg argument is passed to the fn function.

When the fn(arg) function application returns, the child process terminates. The integer returned by fn is the exit code for the child process. The child process may also terminate explicitly by calling exit(2) or after receiving a fatal signal.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the difference between the weight of the fork lift and a car?

Depends on the fork lift and the car.


What is the creation of Linux process called?

fork


What is the phase difference between two prongs of tuning fork?

180


What is the difference between fork and vfork?

Look up information on programming.


What is the fork 100mm travel in mountain bikes stands for?

Means that the difference in length between fully extended and fully compressed fork is 100 mm (4").


Is there a diferece between a fork and a spork?

A fork is s fork. A spork is a spoon ending in short fork tines.


What is the difference between a fork and a spork?

A spork is called a spork because it is the name that made the item popular and well-known. If I went over to a person and said "Foon", they'd probably have no idea what I was talking about. It's just how things turned out.


Difference between parent process and child process?

fork gives a 0 value for child process and non zero for parent process


The junction between separated strands of DNA is called what?

The junction between separated strands of DNA is called a replication fork.


What is the difference between a duel suspension bike and a rigid bike?

Dual suspension is a bicycle with both a suspension fork and a suspension rear. A rigid bike is a bike w/o any suspension, both fork and rear triangle are stiff.


What is the difference between salad fork and fish fork?

Ah, the salad fork and fish fork are like happy little trees in the silverware world. The salad fork typically has broader tines and a slightly larger size, perfect for picking up leafy greens and veggies. Meanwhile, the fish fork is more delicate with a longer, slender shape, designed specifically for enjoying delicious seafood dishes. Just remember, there are no mistakes in silverware, only happy accidents!


What is the difference between a fork lift and a towmoter?

A Towmotor is a make of forklift. One of the earliest manufacturers and still around making very useful small forklifts.