Does Linux provide an exception handling in C without resorting to C++? Or, what might be the best way to implement such an exception handling? The goal is to avoid to check return codes for every function called, but do something like in C++ that is thread safe and easily portable.
You can handle the signals by writing your signal handlers for it. Some of these signals documented at GNU are:
You can get more info in depth about this here. It states the following which I suppose is what you are looking for:
If you anticipate an event that causes signals, you can define a handler function and tell the operating system to run it when that particular type of signal arrives.
I've never heard of Linux providing anything like that, but this page describes a third-party exception handling library for C: http://www.on-time.com/ddj0011.htm I haven't been able to find the download link, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With