This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Cntrl-C Exit and Error Exits Question
- From: Thomas Dineen <tdineen at ix dot netcom dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 11 Jul 2017 12:35:48 -0700
- Subject: Cntrl-C Exit and Error Exits Question
- Authentication-results: sourceware.org; auth=none
Gentle People:
Some questions on program exits and exit error handlers.
I am developing a multi-platform application using Gnu/Gcc tools.
When you Cntrl-C a program is an exit handler of function called?
Is it possible to attach a user supplied Exit Handler to do some
cleanup like close sockets?
When I Cntrl-C my program it appears the a socket may be left open
causing errors when I restart the program. So I am thinking about exit
handlers to close sockets, close files, and release memory.
If a program crashes on a common error like divide by zero, or bad
pointer is it possible to add an error handler to catch and process these
errors?
Thomas Dineen