Hi, attached is a small test program. Compile simply with: $ gcc atexit.c -o atexit When running the test I get: $ ./atexit terminating on_exit called atexit called When the abort() call is uncommented I get: $ ./atexit terminating Aborted (core dumped) Hope this helps, Tomas
#define _DEFAULT_SOURCE #include <stdio.h> #include <stdlib.h> void one(void) { puts("atexit called"); } void two(int, void*) { puts("on_exit called"); } int main(void) { atexit(one); on_exit(two, NULL); puts("terminating"); //abort(); exit (EXIT_SUCCESS); }