info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect return code on vms...


From: Rex_Jolliff
Subject: Re: incorrect return code on vms...
Date: Mon, 04 Dec 2000 10:10:54 -0800


> Donald Sharp <address@hidden> wrote:

>If vms isn't setting EXIT_FAILURE or EXIT_SUCCESS then we
>need to fix the #defines in system.h to do the right thing
>on vms.

>Also we should not be returning 0, we should be using EXIT_SUCCESS
>in the code in main() in order for the right thing to be done...

VMS will do the right thing if you call exit, either with the #defines
or with 0.  Returning from main, on the other hand,

$ create x.c
#include <stdlib.h>
int main(void) { return EXIT_SUCCESS;}
$ cc x
$ link x
$ run x
$ show sym $status
  $STATUS == "%X00000001"
-----
$ create x.c
#include <stdlib.h>
int main(void) { return EXIT_FAILURE;}
$ cc x
$ link x
$ run x
$ show sym $status
  $STATUS == "%X10000002"
-----
$ create x.c
int main(void) { return 0;}
$ cc x
$ link x
$ run x
$ show sym $status
  $STATUS == "%X00000001"
-----
$ create x.c
int main(void) { return 1;}
$ cc x
$ link x
$ run x
$ show sym $status
  $STATUS == "%X00000001"
-----
$ create x.c
int main(void) { return 2;}
$ cc x
$ link x
$ run x
%NONAME-E-NOMSG, Message number 00000002
-----
$ create x.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {printf("%08lx %08lx\n", EXIT_SUCCESS, EXIT_FAILURE); return 0;}
$ cc x
$ link x
$ run x
00000000 10000002

>Having said all that I bet this is a moot point in a lot of respects.
>Is anyone even using VMS?

Yea, all five of us. ;) Most of us who still use it are somewhat religious about
it since we realize its superiority over other operating systems. However, due
to
typical management inability to recognize such engineering greatness, we are on
the
hook to migrate off of it to something less desirable like some flavor of Unix.
;)

Rex.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]