Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Function

Closes file descriptors

Flushes buffers

Deletees temporary files

Calls functions registered with atexit() functions

abort()

unspecified

unspecified

unspecified

no

_exit(status)

yes

unspecified

unspecified

no

exit(status)

yes

yes

yes

yes

atexit()

You can use the Standard C atexit() function to customize exit() to perform additional actions at program termination.

For example, calling:

Code Block
bgColor#ccccff
  atexit(turn_gizmo_off); 

"registers" the turn_gizmo_off() function so that a subsequent call to exit() will invoke turn_gizmo_off(); as it terminates the program. The C standard says that atexit() should let you register up to 32 functions.

...