The Question is:
I use sys$forcex to call the exit handler of a detached process, passing in a
This works ok on a Vax, but on the Alpha the exit handler is called, but the
status is not as expected.
j_value = SS$_ABORT
j_status = sys$forcex ( , c_proc_str(1:i_len), %val(j_value) )
INTEGER*4 J_ARGS /0/
RECORD /EXIT_DESCRIPTOR/ EXIT_DSCRPT
COMMON /EXITDS/ JC_DUMMY
! Declare exit handler
EXIT_DSCRPT.J_ADDR = %LOC(EXIT_HANDLER)
EXIT_DSCRPT.J_ANARG = %LOC(JC_DUMMY)
SUBROUTINE EXIT_HANDLER (j_status)
CALL EXIT (j_status)
The Answer is :
That the exit handler is triggered would imply the call is arriving
correctly in the process, but that the associated data structures
or the associated exit handler routine is somehow invalid.
On of the key requirements fo the exit handler storage is that it
is declared outside the scope of any routine; that the storage is
declared as a COMMON or as static storage. That appears to be
the case here, but is common source of errors with this call.
You can find a Fortran example of the sys$dclexh call in the
Natural Language Search Assistance (AskQ) database, using a
search string such as
Fortran $dclexh call example?
The support database also includes a number of other examples of
other calls for other routines and other languages, as cited in
the OpenVMS FAQ and elsewhere.
In your case, the OpenVMS Wizard would also expect the argument count
should be set to one (1), as you are passing the condition value to
the exit handler routine; the exit handler has an argument. The
description structure is a declaration of the exit handler argument
list and related, and must match the exit handler calling sequence.