##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Program support utilities

From cppreference.com
< c

### [edit] Program termination

The following functions manage program termination and resource cleanup.

Defined in header `<stdlib.h>`
abort | causes abnormal program termination (without cleaning up) (function) [edit]
exit | causes normal program termination with cleaning up (function) [edit]
quick_exit (C99) | causes normal program termination without completely cleaning up (function) [edit]
_Exit (C99) | causes normal program termination without cleaning up (function) [edit]
atexit | registers a function to be called on exit() invocation (function) [edit]
at_quick_exit (C99) | registers a function to be called on `quick_exit` invocation (function) [edit]
EXIT_SUCCESS EXIT_FAILURE | indicates program execution execution status (macro constant) [edit]

### [edit] Communicating with the environment

system | calls the host environment's command processor (function) [edit]
getenv | access to the list of environment variables (function) [edit]

### [edit] Signals

Several functions and macro constants for signal management are provided.

Defined in header `<signal.h>`
signal | sets a signal handler for particular signal (function) [edit]
raise | runs the signal handler for particular signal (function) [edit]
sig_atomic_t | the integer type that can be accessed as an atomic entity from an asynchronous signal handler (typedef)
SIG_DFL SIG_IGN | defines signal handling strategies (macro constant) [edit]
SIG_ERR | error was encountered (macro constant) [edit]
##### Signal types
SIGABRT SIGFPE SIGILL SIGINT SIGSEGV SIGTERM | defines signal types (macro constant) [edit]

### [edit] Non-local jumps

Defined in header `<setjmp.h>`
setjmp | saves the context (function macro) [edit]
longjmp | jumps to specified location (function) [edit]
##### Types
jmp_buf | execution context type (function) [edit]

### [edit] See also

C++ documentation for Program support utilities

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/program&oldid=71027"