handle core

Hi

I am looking for analog of the Windows "try-except" C code statement that enables target applications to gain control when events that normally terminate program execution occur.

See the sigaction() system call man page. The easiest way to do this is create signal handling routines in your code that are called when signals are received. Most, but not all, signals can be caught and handled. Off the top of my head, the few that can't be handled are SIGKILL and SIGSTOP in both single and multi-threaded applications, and SIGWAITING, SIGCANCEL, and SIGLWP in multi-threaded applications.

A good book covering signals and other advanced UNIX programming topics is

Advanced Programming in the UNIX Environment
by W. Richard Stevens
ISBN 0201563177

You can find it on amazon at

http://www.amazon.com/exec/obidos/ASIN/0201563177/qid=1011846437/sr=1-1/ref=sr\_1\_86_1/103-5209275-1145405