- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application which is running some calculations. I would like to handle Ctrl+C or Ctrl+Break so that the application does not stop with "error (69): process interrupted (SIGINT)" after using them.
I tried using SIGNALQQ like this:
[cpp]use ifportThe function processBreakSignal which is registered to process the break signal is obviously called, because the message from the function is shown on the screen, but the application stops with the error(69).
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
status = SIGNALQQ ( SIG$INT, processBreakSignal ) ! SIG$INT
status = SIGNALQQ ( SIG$TERM, processTerminationSignal ) ! SIG$TERM
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]
Is there any way how to resolve this problem? I have not found information about the return value of the function; could it be the way? I tried 1, 0, -1, but it made no difference.
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