Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   "Structured Error Handling" & linux systems (http://www.programmingforums.org/showthread.php?t=11053)

rsnd Aug 12th, 2006 11:33 PM

"Structured Error Handling" & linux systems
 
umm...what do you call "SEH" in linux? Something I can use to execute a piece of code when something goes wrong in a thread instead of crashing the whole program. Or is it like...the whole program does not crash for random thread crash in linux?

Thanks

grumpy Aug 13th, 2006 2:01 AM

SEH is a feature provided by Microsoft operating systems. There is no direct equivalent under any form of unix (including linux). The closest might be signals, which are essentially messages sent to a process. Signals can be initiated by a program, by users (eg hitting CTRL-C to terminate a program typically involves a program being sent a signal by a shell), and by the operating system (most commonly in response to an error by the program eg a "segmentation fault" is detected by the operating system, which sends an appropriate signal to the program). Programs can register signal handlers to respond to each type of signal (although there are a couple of special signals that cannot be caught by a signal handler).

The means of sending signals, and also of registering signal handlers, are operating system specific. Typically, a signal can be sent by calling a function named kill() or something similar, while a signal handler can be registered by calling a function named signal() or something similar.


All times are GMT -5. The time now is 12:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC