neat function, havnt seen that one before...
but that doesnt solve the problem when waiting on select() and a signal happens.
I thought of something while staring at the wall... would it be that im not handing the execpt read list in select(), so when a user tries to CTRL+C out, its trying to write the the except read list, but since its null, it is crashing?
i will have to do some studying.
Thanks again for the input, and any other input you may be able to give.
The atexit() function adds the function func to a list of functions to be called without parameters on normal termination of the program. Normal termination occurs by either a call to exit() or a return from main(). The functions are called in the reverse order of their registration.
On Unix, You could try catching sighup, sigint or sigterm. One of them might equate to ctrl-C. sigkill or kill -9 isn't catchable. If ctrl-c equates to that, then you cannot catch it. The OS has been made this way so it is possible to kill rogue processes and the rogue processes cannot trap that signal to stop themselves from being killed.
On Windows, Ctrl-C is copy, Ctrl-X is cut, Ctrl-V is paste so you can probably catch it but it won't do what you want. In windows programming: you could try trapping the WM_KEYDOWN. The Ctrl-Break sequence is called VK_CANCEL.