Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28996 Discussions

SIGNALQQ and SIGINT won't let the application continue running

jirina
New Contributor I
301 Views

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?

 

0 Kudos
0 Replies
Reply