A process is a program that is being executed. The attributes that a process can have vary from one operating system to another. For this reason, the process control functions work in ways that are specific to certain systems.
In operating systems such as Unix and Windows,
each process is started in an environment represented by a list of
strings with the form
These "environment variables" can
be read using the function
invokes the system's
command interpreter and gives it a command to execute.
A C program is normally terminated via a call to
, or by a
statement in the function
. On normal termination, the following
actions are performed:
Any functions that have been installed by
The I/O buffers are flushed and the files closed.
The files created by
tmpfile() are deleted.
, on the other hand, ends a C program
without performing the actions just listed. This function does
produce an error message announcing that the program was aborted,
exit() can be called with one of the
, defined in
stdlib.h, as an argument. In this way the
program can inform its parent process whether it
All of the functions described in this section are declared in the header file stdlib.h.