C process control explained

C process control refers to a group of functions in the standard library of the C programming language implementing basic process control operations.[1] [2] The process control operations include actions such as termination of the program with various levels of cleanup, running an external command interpreter or accessing the list of the environment operations.

Overview of functions

The process control functions are defined in the stdlib.h header (cstdlib header in C++).

FunctionDescription
Terminating
a program
[http://en.cppreference.com/w/c/program/abort abort]causes abnormal program termination (without cleaning up)
[http://en.cppreference.com/w/c/program/exit exit] causes normal program termination with cleaning up
[http://en.cppreference.com/w/c/program/_Exit _Exit] causes normal program termination without cleaning up (C99)
[http://en.cppreference.com/w/c/program/atexit atexit] registers a function to be called on exit invocation
[http://en.cppreference.com/w/c/program/quick_exit quick_exit] causes normal program termination without cleaning up, but with IO buffers flushed (C11)
[http://en.cppreference.com/w/c/program/at_quick_exit at_quick_exit] registers a function to be called on quick_exit invocation
Communicating with
the environment
[http://en.cppreference.com/w/c/program/getenv getenv] accesses the list of the environment variables
[http://en.cppreference.com/w/c/program/system system]calls the host environment's command processor

External links

Notes and References

  1. Book: Crawford, Tony. Peter Prinz. C in a Nutshell. O'Reilly. §16.11 – Process Control. December 2005. 618. 0-596-00697-7.
  2. Book: ISO/IEC 9899:1999 specification . p. 315, § 7.20.4 "Communication with the environment" . 25 November 2011.