vfork()

NAME

vfork() - spawn a new process efficiently, sharing virtual memory

SYNOPSIS

#include <unistd.h>

pid_t vfork(void)

DESCRIPTION

The vfork(2) call creates a new process, just as fork(2) does, but it doesn't fully copy the address space of the parent process. By sharing the space, process creation is much faster in a paged environment. Normally, vfork(2) is a faster way to create a new process before an exec-family call.

However, the greater speed has a greater risk to the parent process if the child process does not immediately exec(2) or _exit(2). (Leaving with exit(3) isn't recommened because exit(3) flushes and closes the I/O data structures of the parent.)

RETURN VALUE

On success, vfork(2) call returns with 0 to the child process and it returns the process ID of the child process to the parent process. If the call fails, it returns -1 to the parent process, does not create a new process, and sets errno to indicate the error.

ERRORS

The vfork(2) call can fail for the following reasons:

[EAGAIN]
Creating the new process would exceed the limit on running processes, either a system-wide limit or a per-user limit.
[ENOMEM]
There is not enough swap space for the new process.

SEE ALSO

exec(2)

exit(3)

fork(2)

wait(2)

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.