.Sh SYNOPSIS
.Fd #include <unistd.h>
.Ft pid_t
-.Fn vfork void
+.Fo vfork
+.Fa void
+.Fc
.Sh DESCRIPTION
-.Fn Vfork
+.Fn vfork
can be used to create new processes without fully copying the address
space of the old process, which is horrendously inefficient in a paged
environment. It is useful when the purpose of
.Xr fork 2
would have been to create a new system context for an
.Xr execve .
-.Fn Vfork
+.Fn vfork
differs from
.Xr fork
in that the child borrows the parent's memory and thread of
or abnormally.)
The parent process is suspended while the child is using its resources.
.Pp
-.Fn Vfork
+.Fn vfork
returns 0 in the child's context and (later) the pid of the child in
the parent's context.
.Pp
-.Fn Vfork
+.Fn vfork
can normally be used just like
.Xr fork .
It does not work, however, to return while running in the childs context
.Xr exit
since buffered data would then be flushed twice.)
.Sh SEE ALSO
-.Xr fork 2 ,
.Xr execve 2 ,
+.Xr fork 2 ,
.Xr sigaction 2 ,
-.Xr wait 2 ,
-.Sh DIAGNOSTICS
-Same as for
-.Xr fork .
+.Xr wait 2
+.Sh ERRORS
+The
+.Fn vfork
+system call will fail for any of the reasons described
+in the
+.Xr fork
+man page.
+In addition, it will fail if:
+.Bl -tag -width Er
+.\" ===========
+.It Bq Er EINVAL
+A system call other than
+.Xr _exit()
+or
+.Xr execve()
+(or libc functions that make no system calls other than those)
+is called following calling a
+.Fn vfork
+call.
+.El
.Sh BUGS
This system call will be eliminated when proper system sharing
mechanisms are implemented.