is there a “built-in” way to know the exit code passed to exit inside an exit handler installed with atexit?
For example, if a call exit(EXIT_FAILURE), my handler will perform different operations than in case of exit(EXIT_SUCCESS).
I could solve that with a global variable, but that would negate the comfort of calling exit no matter where in my program.
With
atexitno. But you could use theon_exitfunction :Well, you must use gnu libc …