[mod.computers.vax] SYS$HIBER trouble in UIS application

winalski@psw.DEC.COM.UUCP (01/26/87)

There are several problems with your SYS$WAKE call that I can see:

1) SYS$WAKE takes two parameters, whereas you passed only one.

2) To specify a zero PID value to deafult the PID to the current process,
   you must either omit the PID parameter or specify it as a 0 passed BY
   VALUE.  The call as you specified it:
   
>   	status = sys$wake(pid)

   passes the zero PID value by reference.  The call should be:
   
   	status = sys$wake(%val(0))
   
   or even better:
   
   	status = sys$wake(,)

3) The "message number 0" problem occurs because SYS$WAKE begins with the
   letter "S".  It is therefore a REAL subroutine.  The return value from
   SYS$WAKE (which should be SS$_NONEXPR in this case) is being converted
   to INTEGER because STATUS is an INTEGER*4 variable.  Viewed as a floating
   point number, SS$_NONEXPR is a "dirty zero" value.  Thus, STATUS gets
   the value 0 and when you SIGNAL it, you get the "message number 0"
   display.
   
   You must say:
   
   	INTEGER*4 sys$wake
   
   at the top of the subroutine, or add the line:
   
   	INCLUDE '($SYSSRVNAM)'
   
   at the top of the subroutine.  Remember that in FORTRAN, every program
   unit is independent.  The INCLUDEs that you did in the main program don't
   carry over to the subroutines.

--PSW