Better replacement for exit(), atexit() in C
问题 I am new to C programming. I used to think using exit() was the cleanest way of process termination (as it is capable of removing temporary files, closing open files, normal process termination...), but when I tried man exit command on the terminal (Ubuntu 16.04.5, gcc 5.4.0) I saw the following line: The exit() function uses a global variable that is not protected, so it is not thread-safe. After that I tried to make some research about better replacement for exit() (to change my programming