Re: What happens to parent process, when a child process is created using vfork() and killed before calling exec

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

 



On Tue, Oct 28, 2014 at 11:01:31AM +0000, Kevin Peterson wrote:
> Hi, 
> 
> When a process is created using vfork() child process is created and
> starts running in the parent process address space, until exit() or
> exec() is called. 
> 
> What happens to the parent process, if some one kills the child process
> before calling the exit()/exec()?

According to the vfork man page:

       vfork()  differs  from  fork(2) in that the calling thread is suspended
       until the child terminates (either normally, by  calling  _exit(2),  or
       abnormally,  after  delivery  of a fatal signal), or it makes a call to
       execve(2).  Until that point, the child shares all memory with its par‐
       ent,  including  the stack.  The child must not return from the current
       function or call exit(3), but may call _exit(2).

So I should imagine that when the child is killed, the parent resumes,
and can call wait() and retrieve the child's exit status.


-- 
"Procrastination grows to fill the available time"
    -- Mitchell's corollary to Parkinson's Law
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux