return from a signal handler in C++



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

return from a signal handler in C++

Postby parulchahar » Tue Dec 09, 2008 11:35 pm

Hi,
I'm working on a C++ application. The application need to handle system exceptions. The asynchronous exceptions raises signal.
Hence, system exceptions cannot be catched but the signal that is generated can be handled in a signal handler function.

The issue with signal handler is, how can I return back to the function that causes this signal. Returning is required as the resources are to be freed
before terminating the application. Thus memory leakage can be avoided.
parulchahar
 
Posts: 2
Joined: Tue Dec 09, 2008 11:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: return from a signal handler in C++

Postby napanap » Tue Jan 27, 2009 7:52 am

You can use setjmp() to set a location, and longjmp() to jump back to it.
napanap
 
Posts: 7
Joined: Tue Jan 27, 2009 7:12 am
Has thanked: 0 time
Been thanked: 0 time


Return to C, C++

 


  • Related topics
    Replies
    Views
    Last post