Re: vfork()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2003-02-02 at 22:48, Rupa wrote:

>   I have a small doubt regarding the working of vfork() system call.
> when a call to vfork() is made, the child process created will be
> sharing the address space of the parent. I want to know whether the
> pid returned by the vfork() is same as the pid of parent. Because in
> case of fork() system call, child process differs from the parent by
> pid. I want to know regarding pid in case of vfork() system call.

No, the pid is different.  The end result of fork vs. vfork is the same.

The child only shares the parent's address space until it exits or calls
exec.  While the address space is shared, the parent is sleeping and
cannot run.  It wakes when the child execs or exits.

You can see this logic in kernel/fork.c

	Robert Love

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux