Manual Reference Pages - VFORK (2)
- create a new process without copying the address space
can be used to create new processes without fully copying the address
space of the old process, which is horrendously inefficient in a paged
It is useful when the purpose of
would have been to create a new system context for an
in that the child borrows the parents memory and thread of
control until a call to
or an exit (either by a call to
The parent process is suspended while the child is using its resources.
returns 0 in the childs context and (later) the pid of the child in
the parents context.
can normally be used just like
It does not work, however, to return while running in the childs context
from the procedure that called
since the eventual return from
would then return to a no longer existent stack frame.
Be careful, also, to call
if you cannot
will flush and close standard I/O channels, and thereby mess up the
parent processes standard I/O data structures.
it is wrong to call
since buffered data would then be flushed twice.)
Same as for
system call appeared in
BSD 3 .
To avoid a possible deadlock situation,
processes that are children in the middle
are never sent
and input attempts result in an end-of-file indication.
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.