Program Termination (The GNU C Library) (original) (raw)


25.7 Program Termination

The usual way for a program to terminate is simply for its mainfunction to return. The exit status value returned from themain function is used to report information back to the process’s parent process or shell.

A program can also terminate normally by calling the exitfunction.

In addition, programs can be terminated by signals; this is discussed in more detail in Signal Handling. The abort function causes a signal that kills the program.