RE: vfork()

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

 



Hi Rupa,
 
If you see man page for vfork the RETURN VALUE part will answer your query
 

RETURN VALUES

If successful, vfork() returns 0 in the child process, and returns the process ID of the child process to the parent process. On failure, it returns -1 and sets errno to one of the following values:

It says clearly that as far as pid is concerned "vfork" behaves exactly as "fork".
 
I think and its pretty obvious that pid of parent and chield should be different after vfork. Because one pid is one PCB-process control block. If pid is same i.e. PCB is same.
 
If PCB's are same i.e. they are same processes. Also when chield "exec" it will overwrite the parent and not "chield" process
 
HTS,
aniruddha
 
 -----Original Message-----
From: Rupa [mailto:rupa.ramakrishna@ionidea.com]
Sent: Monday, February 03, 2003 9:19 AM
To: kernelnewbies@nl.linux.org
Subject: vfork()

 
Hello,
  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.
 
If I am wrong correct me.
 
Thanks in advance,
Rupa

[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