Rafael Garcia-Suarez wrote:
"John E. Malmberg" <[EMAIL PROTECTED]> wrote:
This change seems to have forced the several routines that were
translating the status correctly on VMS to use STATUS_EXIT which is
basically resulting a number of success status values being translated
to a fatal error condition instead of being passed through.
I am not sure that I can untangle this so that the old somewhat broken
VMS exit behavior is completely preserved.
I am not sure we want to preserve the old behaviour in 5.10. More
consistency would be appreciable, esp. now that we have more variables
to look at with the new ${^CHILD_ERROR_NATIVE}.
I will see what I can do to untangle things.
I see that there are references to NATIVE, POSIX, and UNIX statuses in
PERL.H.
When would UNIX be different than POSIX?
On VMS when I translate from NATIVE to UNIX, there is a significant loss
of error information, that can not always be recovered.
There are also two cases, program exit, and errno codes. On internal
errno codes, the values match what is found in errno.h and should be
interpreted that way.
I will need separate macros/routines for converting UNIX "errno" codes
to VMS NATIVE status values then are used for converting UNIX "exit"
codes to VMS NATIVE status values.
When the VMS NATIVE status value is properly created, I only need one
routine to convert it back to the original UNIX exit code, or the UNIX
error code that most closely matches the VMS NATIVE code.
On a program exit, the UNIX value returned is one with no special
meaning, other than 0 generally indicates a success. Converting such a
UNIX value to a VMS status value is done by:
vms_status = 0x35A000 | ((unix_status & 0xFF) << 3)
if unix_status != 0;
vms_status = 1 if unix_status == 0;
If the vmsish pragma is set, then the unix_status to the exit command
should be presumed to be a valid VMS status, so no translation should be
done.
Regardless of the vmsish pragma, a UNIX exit status greater than 0xFF
should be considered a VMS status and not translated. As there is only
one byte actually designated to to hold the UNIX exit status code
currently on VMS.
On converting from UNIX errno values to NATIVE, the only way that I can
see to do this with the minimum of damage is to first translate the
current vaxc$errno value to UNIX and see if it matches the current UNIX
status, and if so, use it for NATIVE. Otherwise I need to use a lookup
table to convert the UNIX errno value to a VMS value that could mean the
same thing.
-John
[EMAIL PROTECTED]
Personal Opinion Only