IPB
>  Man Pages > Unix > FreeBSD 6.2 > Section 2 > vfork man page

vfork man page

Section 2 - FreeBSD 6.2 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!


VFORK(2)                  FreeBSD System Calls Manual                 VFORK(2)


NAME

     vfork -- spawn new process in a virtual memory efficient way


LIBRARY

     Standard C Library (libc, -lc)


SYNOPSIS

     #include <unistd.h>

     pid_t
     vfork(void);


DESCRIPTION

     The vfork() system call can be used to create new processes without fully
     copying the address space of the old process, which is horrendously inef-
     ficient in a paged environment.  It is useful when the purpose of fork(2)
     would have been to create a new system context for an execve(2).  The
     vfork() system call differs from fork(2) in that the child borrows the
     parent's memory and thread of control until a call to execve(2) or an
     exit (either by a call to _exit(2) or abnormally).  The parent process is
     suspended while the child is using its resources.

     The vfork() system call returns 0 in the child's context and (later) the
     pid of the child in the parent's context.

     The vfork() system call can normally be used just like fork(2).  It does
     not work, however, to return while running in the child's context from
     the procedure that called vfork() since the eventual return from vfork()
     would then return to a no longer existent stack frame.  Be careful, also,
     to call _exit(2) rather than exit(3) if you cannot execve(2), since
     exit(3) will flush and close standard I/O channels, and thereby mess up
     the parent processes standard I/O data structures.  (Even with fork(2) it
     is wrong to call exit(3) since buffered data would then be flushed
     twice.)


RETURN VALUES

     Same as for fork(2).


SEE ALSO

     execve(2), _exit(2), fork(2), rfork(2), sigvec(2), wait(2), exit(3)


HISTORY

     The vfork() system call appeared in 2.9BSD.


BUGS

     This system call will be eliminated when proper system sharing mechanisms
     are implemented.  Users should not depend on the memory sharing semantics
     of vfork() as it will, in that case, be made synonymous to fork(2).

     To avoid a possible deadlock situation, processes that are children in
     the middle of a vfork() are never sent SIGTTOU or SIGTTIN signals;
     rather, output or ioctl(2) calls are allowed and input attempts result in
     an end-of-file indication.

FreeBSD 6.2                      June 4, 1993                      FreeBSD 6.2


Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Wed Sep 19 20:04:15 BST 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5327 hits)
(openSUSE 10.2)

svn man page (5200 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4869 hits)
(Solaris 10 11_06)

CPAN man page (4604 hits)
(Suse Linux 10.1)

ssh man page (4341 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2862 hits)
(Solaris 10 11_06)

netcat man page (2704 hits)
(Suse Linux 10.1)

pprosetup man page (2480 hits)
(Solaris 10 11_06)

startproc man page (2469 hits)
(Suse Linux 10.1)

signal man page (2400 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: PYRENEES ACTIVITY HOLIDAYS :: PCB Layout Bedfordshire :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum