answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between parent process and child process?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between a biological and a adoptive parent?

The difference between a biological parent and an adoptive parent is that the biological parent is the one who is related to the child by blood and the adoptive parent is the one that raised the child.


What is the difference between a child and their parent?

your parent is a grown up as if you are a baby


What are child and parent processes?

A child process is a process that was created by a parent process. The child process usually helps the parent process accomplish some task independently of the parent.


Difference between child process and threads in operating systems?

In operating systems, a child process is a new process created by an existing process, which operates independently and has its own memory space. Whereas a thread is a subset of a process, sharing the same memory space and resources as the parent process. Threads are lighter weight and more efficient compared to processes in terms of resource utilization.


When a process creates a new process using what state is shared between the parent process and the child process?

shared memory segment


What is Zombie Process and Orphan Process?

Zombie : Child Process Exits before Parent process and Parent does not grab status of child process using wait() or waitpid() system call; Child process is in Zombie state. Orphan : Child process whose parent has been killed and inherited by init process.


What is the difference between parenting and parenthood?

Parenthood is a state of being and becoming a parent and asuming the asociated responsibilities. Parenting is the act of performing the roles and responsibilities of a parent. Parenting may be performed by people who are nt parents themseves.


What is the process for a child age 12 to choose which parent he wants to live with?

There is no such process. A child of 12 is not allowed to choose.


What is a fork in computer programming?

Fork() is a concept that originated in the UNIX world. Running programs are called processes, and the only way to execute a new program is for a current program to fork() itself, thereby creating a separate process. The process that called fork() is known as the parent process, and the newly created process is known as the child process. The child process, which begins its life as a copy of the parent process, can be "replaced". In UNIX, the first program that is executed after booting finishes is the init process. This process will fork() and load the getty program over the child process, thereby creating a process which will prompt the user for a password. Since a call to fork() creates a child process which is in essence the same as the parent process, it is necessary to determine (from within the process) which process is the child, and which is the parent. Upon successful execution, the fork() call returns the child's Process ID in the parent process, and a 0 in the child process. You can then use the child to execute a system call, such as running another program (or whatever you needed a second process for). If you are using pipes (for communication between the child and parent process), make sure you have the parent wait for it. --- In open source programming, a fork is a separate project that starts as a copy of another one. If the developers have it out with one another, or a developer wants to take the project in a different direction, then they copy the source code to a new repository and work on it there, completely separate from the original project.


How can a parent sign their child over to a non-relative out of the country without a long court process?

because the parent is the child's guardian and the guardian has the power to decide who will care for the child.


When should a parent teach their child about the difference between sexes?

Teaching a child about the differences between the sexes is a personal choice. However, most children learn this information prior to entering pre-school so that they understand the differences between their peers.


What is the difference between clone and fork in Linux?

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.