[Info-vax] Suppressing DCL exit status messages
Arne Vajhøj
arne at vajhoej.dk
Tue Sep 12 15:52:16 EDT 2023
On 9/12/2023 8:34 AM, Simon Clubley wrote:
> On 2023-09-11, gah4 <gah4 at u.washington.edu> wrote:
>> It was a C program that I wrote, and that had exit(8); in it.
>>
>> There was no access violation.
>
> I am surprised nobody told you the error message could be suppressed
> if you set the right bit in the exit status you return to DCL:
>
> $ exit 8
> %SYSTEM-W-ACCVIO, access violation, reason mask=00, virtual address=0000000000000008, PC=000000007AF0D9F0, PS=00000000
> $ write sys$output $status
> %X00000008
>
> $ exit %x10000008
> $ write sys$output $status
> %X10000008
>
> Note that it's that specific bit which needs setting as you still get
> the message in this case:
>
> $ exit %x40000008
> %SYSTEM-W-ACCVIO, access violation, reason mask=00, virtual address=0000000040000008, PC=000000007AF0D9F0, PS=00000000
> $ write sys$output $status
> %X40000008
>
> You can mask off the top 4 bits (the internal control flags) to
> extract out the actual number your program returned to your DCL script.
>
> Not sure where I found this out because it's not in the manuals
> I just checked.
It is documented and has been as long as I can remember.
$ type simon.c
#include <string.h>
#include <stsdef.h>
#include <starlet.h>
int main(int argc, char *argv[])
{
if(argc > 1 && strcasecmp(argv[1], "simonsaysquiet") == 0)
{
sys$exit(STS$M_INHIB_MSG | 8);
}
else
{
sys$exit(8);
}
}
$ cc simon
$ link simon
$ simon :== $sys$disk:[]simon.exe
$ simon
%SYSTEM-W-ACCVIO, access violation, reason mask=00, virtual
address=0000000000000008, PC=0000000000000012, PS=00000003
$ sh symb $status
$STATUS == "%X00000008"
$ simon SimonSaysQuiet
$ sh symb $status
$STATUS == "%X10000008"
Arne
More information about the Info-vax
mailing list