[Info-vax] Learning VMS application programming
John E. Malmberg
wb8tyw at qsl.network
Sun Sep 7 00:55:14 EDT 2014
On 9/6/2014 11:30 PM, JF Mezei wrote:
> On 14-09-06 21:50, John E. Malmberg wrote:
>
>> A common bug in porting Unix programs to VMS is not to set compile time
>> options to use POSIX exit codes and pass those codes to DCL.
>
> If you set compiler options to translate UNIX codes, can you still
> exit(mycode) where mycode is the result of a VMS system call ?
>
> in other words, if you start to make use of VMS system services with VMS
> status codes, is it wise to set that switch I never knew existed to
> mimic Unix exit codes ?
If you use lib$stop or cause lib$signal to exit, then no.
If you are wanting to mix Unix status and VMS status, then you are going
to have convert one to the other yourself, or specifically call the
correct *exit().
decc$exit() is for VMS status, __posix_exit() is for Unix status codes.
While the algorithm is not publicly documented in the VMS manuals, it is
relatively easy to find examples. The VMS specific Perl documentation
covers it.
Regards,
-John
wb8tyw at qsl.network
Personal Opinion Only
More information about the Info-vax
mailing list