From: hoffman@xdelta.enet.dec.com (Stephen Hoffman)
Subject: Re: Successful and not successful completion
Date: 1995/08/14 [thread overview]
Message-ID: <40ns2i$aok@nntpd.lkg.dec.com> (raw)
In-Reply-To: 40c5ab$er4@caip.rutgers.edu
In article <40c5ab$er4@caip.rutgers.edu>,
halasz@caip.rutgers.edu writes:
:In article <1995Aug9.192334.1@sldb5.slac.stanford.edu>,
:fairfield@sldb5.slac.stanford.edu writes
:> ....
:> ... I suggest you study
:> up on VMS _condition values_. A good reference would be the OpenVMS
:> Calling Standard, Chapter 6 (in the V6.1 doc set) which discusses
:
:Why is it a good idea that there is this message,
: %SYSTEM-x-NORMAL, normal successful completion
:which is not meaningful unless x is "S"?
:Why is it a good idea that there is this message,
: %SYSTEM-x-ABORT, abort
:which is not meaningful unless x is "E" or "F"?
:For file not found, even "S" can be useful. No,
:it would hav been better if there were one message,
: %SYSTEM-x-COMPLETION, completion
There is a simple test for successful completion, simply test the low bit
of the condition value. (Condition handling is itself a major topic in
the OpenVMS Programming Manual; using the OpenVMS support, one can easily
implement centralized condition handlers and signals under OpenVMS, and
one can also easily implement a condition handling model with more endemic
one-per-operation handlers.)
If using C, the basic test looks like this:
#include <stsdef.h>
RetStat = Mumble();
if ( !$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
If using VAX macro, the test looks like this:
calls #0,g^Mumble
blbc r0,error
If the low bit is set, the operation succeeded. There was a deliberate
design choice made in OpenVMS to provide this -- the OpenVMS operating
system provides multiple success codes, and multiple failure codes of
various severities, and provides an easy way to perform a blanket "it
worked" or "it failed" test.
I've worked with various applications written for other operating systems,
and I've worked on other operating systems, and I've often found the error
reporting in these situations to be rather inconsistent -- sometimes zero
is success and non-zero is failure, sometimes it's reversed. When zero
is a failure code, one occasionally has to resort to dependence on a
non-reentrant data cell (C routines use errno here) to determine the
reason for the failure. One then needs errno for each thread (or AST)
of execution, where the OpenVMS model is rather easier to deal with.
The OpenVMS scheme certainly appears more baroque when compared with
other schemes and it can certainly be misused by folks testing for one
particular explicit success (or failure) code, but the scheme is what
makes generic recovery routines possible -- one does not need to code
each possible status code, yet one can also easily choose to special-case
a particular set of status codes, status codes from a particular facility,
or status codes of a particular severity level.
------------------------------ Opinionative -------------------------------
Stephen Hoffman OpenVMS Engineering hoffman@xdelta.enet.dec.com
---------------------------------------------------------------------------
next prev parent reply other threads:[~1995-08-14 4:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-08-10 4:00 Successful and not successful completion fairfield
1995-08-10 4:00 ` halasz
1995-08-10 4:00 ` fairfield
1995-08-10 4:00 ` Jeffrey L. Sue
1995-08-11 4:00 ` Derek Dongray
1995-08-12 4:00 ` Carl J Lydick
1995-08-12 4:00 ` Carl J Lydick
1995-08-14 4:00 ` Stephen Hoffman [this message]
[not found] ` <950811113507.608e@alpha.vitro.com>
1995-08-17 4:00 ` halasz
1995-08-24 4:00 ` System Manager
-- strict thread matches above, loose matches on Subject: below --
1995-08-09 4:00 caip.rutgers.edu!halasz
1995-08-12 4:00 ` Carl J Lydick
1995-08-12 4:00 ` Dan Pop
1995-08-12 4:00 ` Carl J Lydick
1995-08-12 4:00 ` Dan Pop
1995-08-12 4:00 ` David P. Murphy
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox