![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MMU exception | Puntino | Linux | 2 | 05-07-2008 09:35 AM |
| How to catch the exception | Vijayakumarpc | UNIX for Dummies Questions & Answers | 0 | 02-07-2007 11:18 PM |
| Help with RPC Exception | ejbrever | HP-UX | 2 | 08-24-2006 11:08 AM |
| RPC Exception - Help | ejbrever | UNIX for Advanced & Expert Users | 0 | 08-21-2006 09:56 AM |
| exception handling | RichardS | UNIX for Advanced & Expert Users | 1 | 06-16-2004 02:29 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to imitate a system call available on Win32
(spit). The functionality is to catch a system exception (i.e. signal) such as divide-by-zero, and convert it to a catchable c++ exception. Can this be done on Unix ? Can i use "throw new <ExcpetionClass>" inside a signal-handling routine ? I am using AIX. Thank you for your time Seeker |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Have you tried it ?
__________________
FreeBSD: The best free Unix on this planet IMHO!! FreeBSD Forums www.freebsdforums.org |
|
#3
|
|||
|
|||
|
No I have'nt - link problems
I will post a message here if I have any advances
|
|
#4
|
|||
|
|||
|
If you set up one handler for each, you will get this to work under Linux.
#include <iostream.h> #include <stdlib.h> #include <signal.h> class sx { public: sx(int sig) { cout << "Signal " << sig << " caught\n"; } }; void handler(int s) { cout << "yes, I'm here\n"; new sx(s); exit(0); } main(int ac, char *av[]) { signal(SIGINT, handler); for (; } Press Ctl-C, and you will get two messages, the signal number is random, because of the this pointer. Atle
__________________
PS All of the above is to be read as '... unless I am wrong' ENDPS |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|