IPB
>  Man Pages > Linux > openSUSE 10.2 > Section 3p > vfork man page

vfork man page

Section 3p - openSUSE 10.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(P)                   POSIX Programmer's Manual                  VFORK(P)



NAME
       vfork - create a new process; share virtual memory

SYNOPSIS
       #include <unistd.h>

       pid_t vfork(void);


DESCRIPTION
       The  vfork()  function  shall  be equivalent to fork(), except that the
       behavior is undefined if the process created by vfork() either modifies
       any  data  other than a variable of type pid_t used to store the return
       value from vfork(), or returns from the function in which  vfork()  was
       called, or calls any other function before successfully calling _exit()
       or one of the exec family of functions.

RETURN VALUE
       Upon successful completion, vfork() shall return 0 to the child process
       and  return  the process ID of the child process to the parent process.
       Otherwise, -1 shall be returned to the parent, no child  process  shall
       be created, and errno shall be set to indicate the error.

ERRORS
       The vfork() function shall fail if:

       EAGAIN The  system-wide  limit  on  the total number of processes under
              execution would be exceeded, or the system-imposed limit on  the
              total number of processes under execution by a single user would
              be exceeded.

       ENOMEM There is insufficient swap space for the new process.


       The following sections are informative.

EXAMPLES
       None.

APPLICATION USAGE
       Conforming applications are recommended not to depend on  vfork(),  but
       to  use  fork()  instead.  The  vfork()  function may be withdrawn in a
       future version.

       On some implementations, vfork() is equivalent to fork().

       The vfork() function differs from fork() only in that the child process
       can share code and data with the calling process (parent process). This
       speeds cloning activity significantly at a risk to the integrity of the
       parent process if vfork() is misused.

       The  use of vfork() for any purpose except as a prelude to an immediate
       call to a function from the exec family, or to _exit(), is not advised.

       The  vfork() function can be used to create new processes without fully
       copying the address space of the old process. If a  forked  process  is
       simply going to call exec, the data space copied from the parent to the
       child by fork() is not used. This  is  particularly  inefficient  in  a
       paged  environment,  making vfork() particularly useful. Depending upon
       the size of the parent's data space, vfork()  can  give  a  significant
       performance improvement over fork().

       The  vfork()  function  can normally be used just like fork().  It does
       not work, however, to return while running in the child's context  from
       the caller of vfork() since the eventual return from vfork() would then
       return to a no longer existent stack  frame.   Care  should  be  taken,
       also,  to call _exit() rather than exit() if exec cannot be used, since
       exit() flushes and closes standard I/O channels, thereby  damaging  the
       parent  process' standard I/O data structures. (Even with fork(), it is
       wrong to call exit(), since buffered data would then be flushed twice.)

       If signal handlers are invoked in the child process after vfork(), they
       must follow the same rules as other code in the child process.

RATIONALE
       None.

FUTURE DIRECTIONS
       This function may be withdrawn in a future version.

SEE ALSO
       exec() , exit() , fork() , wait() ,  the  Base  Definitions  volume  of
       IEEE Std 1003.1-2001, <unistd.h>

COPYRIGHT
       Portions  of  this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
       event of any discrepancy between this version and the original IEEE and
       The  Open Group Standard, the original IEEE and The Open Group Standard
       is the referee document. The original Standard can be  obtained  online
       at http://www.opengroup.org/unix/online.html .



IEEE/The Open Group                  2003                             VFORK(P)


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

This page was generated on Sat Sep 8 16:41:42 GMT 2007

Your favourite pages:

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

Top 10 most popular pages:

svn man page (6164 hits)
(FreeBSD 6.2)

sqlite3 man page (5598 hits)
(openSUSE 10.2)

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

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

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

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

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

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

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

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

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Area :: Server Room Temperature Monitor :: <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