From the bf(C) programming language the ti(fork) system call is well
known. When a program needs to start a new process, ti(system) can be used.
The function tt(system) requires the program to wait for the
        emi(child process)
    to terminate. The more general way to spawn subprocesses is to use
tt(fork).

In this section we investigate how bf(C++) can be used to wrap classes around
a complex system call like tt(fork). Much of what follows in this section
directly applies to the Unix operating system, and the discussion therefore
focuses on that operating system. Other systems usually provide
comparable facilities. What follows is closely related to the
 em(Template Design Pattern)hi(design pattern) (cf. em(Gamma et al.) (1995)
    hi(Gamma, E.) i(Design Patterns), Addison-Wesley)

   When tt(fork) is called, the current program is duplicated in memory, thus
creating a new process. Following this duplication both processes continue
their execution just below the tt(fork) system call. The two processes may
inspect tt(fork)'s return value: the return value in the
original process (called the emi(parent process)) differs from the return
value in the newly created process (called the emi(child process)):
    itemization(
    it() In the em(parent process) tt(fork) returns the emi(process ID) of the
(child) process that was created by the tt(fork) system call. This is a
positive integer value.
    it() In the em(child process) tt(fork) returns 0.
    it() If tt(fork) fails, -1 is returned.
    )
