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

Portability Function SIGNAL: Declaration and usage

markus
Beginner
397 Views
Hello,

Playing around with SIGNAL (defined in IFPORT.F90) I have found:

  1. Documentation says "The result is the previous value of proc associated with the specified signal". But neither Windows nor Linux versions seem to return a valid value. Calling SIGNAL for the second time I would expect it returns the address of the signal handler specified at the previous call. Windows returns 0, Linux some random number.
  2. SIGNAL's interface defines proc as EXTERNAL. Thus it cannot be called with a variable as proc argument. But this is needed if I want to restore a previous signal handler as its address is stored in a variable.
Has someone had success with this?

Markus

Usage:
result = SIGNAL (signum, proc, flag)

Interface:

FUNCTION SIGNAL(SIGNUM, PROC, FLAG)
use ifport_types
!DEC$ ATTRIBUTES DEFAULT :: SIGNAL
INTEGER(POINTER_LEN) :: SIGNAL
INTEGER(4) :: SIGNUM, FLAG
INTEGER(4), EXTERNAL :: PROC
END FUNCTION
0 Kudos
0 Replies
Reply