C process control: Difference between revisions

Content deleted Content added
improve lead; add anchors
Line 3:
{{move to|C process control}}
 
'''C programprocess control operations''' arerefers to a group of functions in the [[C standard library|standard library]] of the [[C programming language]] implementing basic programprocess control operations.<ref>{{cite book|last=Crawford|first=Tony|coauthors=Peter Prinz|title=C in Nutshell|publisher=O'Reilly|___location=§16.11 - ''Process Control''|date=December 2005|pages=618|isbn=0-596-00697-7}}</ref><ref>{{cite book | url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf | title=ISO/IEC 9899:1999 specification | at=p. 315, § 7.20.4 "Communication with the environment" | accessdate=25 November 2011}}</ref> 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.
| url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
| title=ISO/IEC 9899:1999 specification
| at=p. 315, § 7.20.4 "Communication with the environment"
}}</ref>
 
==Overview of functions==
 
The programprocess control functions are defined in the <code>stdlib.h</code> header (<code>cstdlib</code> header in C++).
 
; Terminating a program
*<code>{{man|shanchor|abort|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/abort abort]</code> - causes abnormal program termination (without cleaning up)
*<code>{{man|shanchor|exit|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/exit exit]</code> - causes normal program termination with cleaning up
*<code>{{man|shanchor|_Exit|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/_Exit _Exit]</code> - causes normal program termination without cleaning up
*<code>{{man|shanchor|atexit|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/atexit atexit]</code> - registers a function to be called on exit() invocation
 
; Communicating with the environment
*<code>{{man|shanchor|getenv|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/getenv getenv]</code> - accesses the list of the environment variables
*<code>{{man|shanchor|system|SUS||inline}}<code>[http://en.cppreference.com/w/cpp/utility/program/system system]</code> - calls the host environment's command processor
 
==References==
Line 30 ⟶ 26:
 
[[Category:C Standard Library]]
 
 
{{prog-lang-stub}}