[Info-vax] completion status from LIB$SPAWN

Steven Schweda sms.antinode at gmail.com
Fri Apr 27 02:57:53 EDT 2012


> 1. For the benefit of anyone reading this thread, the above
> is described in the C manual.

   At least.  <stsdef.h> (possibly available as
SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]STSDEF.H) offers
related info to the C-literate.

> So the question remains: why would VMS return 2 values for
> Normal Completion?

   "VMS" doesn't return a status value, a program does.  The
STS$M_INHIB_MSG bit could be set in many places.

> How are programmers expected to handle it without going the
> route of the procedure posted by Briggs above.

   I've never done much in BASIC, but in C, a typical
procedure looks something like the following:

      #include <stsdef.h>

      int status;

      status = [whatever];
      if ((status & STS$M_SUCCESS) != STS$K_SUCCESS)
      {
          [Do whatever you want for any non-Success status.]
      }

Which, while it does emphasize the distinction between a bit
mask and a particular masked-off value, is not much different
in effect from:
      IF (SPAWN_STATUS AND SS$_NORMAL)<>1% THEN
Is it?

> [...] Severity 2-0 is 1 which implies SUCCESS.

   If "Severity 2-0" means that the severity comprises the
low three bits, then: Yup.  But:
      if ((status & STS$M_SUCCESS) != STS$K_SUCCESS)
and:
      if ((status & STS$M_SEVERITY) != STS$K_SUCCESS)
are not quite equivalent.



More information about the Info-vax mailing list