- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application which tries to handle interrupt signals. I use SIGNALQQ for that, so it goes like this in my code:
[java] use ifport
interface
function processBreakSignal ( signum ) ! SIG$INT - CTRL+CSIGNAL
!dec$ attributes C :: processBreakSignal
integer*4 processBreakSignal
integer*2 signum
end function
function processTerminationSignal ( signum ) ! SIG$TERM - Termination
!dec$ attributes C :: processTerminationSignal
integer*4 processTerminationSignal
integer*2 signum
end function
end interface[/java]
[cpp] status = SIGNALQQ ( SIG$INT, processBreakSignal ) ! SIG$INT
status = SIGNALQQ ( SIG$TERM, processTerminationSignal ) ! SIG$TERM[/cpp]
The function processBreakSignal reads:
[cpp] integer*4 function processBreakSignal ( signum )
!dec$ attributes C :: processBreakSignal
integer*2 signum
write(*,'(a)') ' Application is stopping due to Ctrl+C. '
write(*,'(a)') ' Please wait until it finishes. '
call writeStopSignal()
processBreakSignal = 1 ! is return value somehow used?
return
end[/cpp]
When I run my application, the message from the function is shown on the screen, but the application is then stopped with the error (69): process interrupted (SIGINT). If I want the application to continue, what should I do? Can I influence the behavior of the application by changing the return value of the function?
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page