I think I have the exit code stuff figured out, and I am trying to figure out how to add the option required by GNV to return the UNIX exit codes embedded in a VMS status.

The vmsish pragma does not make sense to enable this feature, as it is really a case of being compatible with GNV and other C programs.

It really looks like what would be needed is a posixish pragma to request levels of posix compliance.

The existing behavior that was recently broken in blead was apparently to pass through all codes except 0 and 1 as is.

Normally 0 was translated to SS$_NORMAL and 1 was translated to SS$_ABORT.

use vmsish 'exit' translates the UNIX 1 to be 0, and leaves the UNIX 0 as 0, and leaves the others unchanged.

What was recently broken is that the unchanged values got filtered through STATUS_UNIX_SET() which then converted them all to SS$_ABORT.

Now what makes sense to me is that by default, 0 and 1 get translated to SS$_NORMAL and SS$_ABORT as before.

And any values above 0xFFFF get passed regardless of the settings.

Values between 0x0100 and 0xFFFE indicate that there is both a parent
and a child status, and should not have reached the exit code, so the
assumption is that these were also intended to be VMS error codes and also always passed through.

It is for the values between 1 and 255 that the posix_exit setting would effect. When the POSIX exit setting is in effect, those values would be
encoded as if they were passed to the CRTL _posix_exit() routine, which
means that BASH will see the original values.  SS$_NORMAL is already
translated back to 0.

The with out the POSIX exit setting, code 1 will be handled as before, and codes 2 through 255 will be passed through.

STATUS_UNIX_SET can not be used for this purpose and also be used in the other places it is used. A STATUS_UNIX_EXIT_SET would be needed.

STATUS_UNIX_SET for the other places also needs to be fixed.

This may allow some later cleanup, but this would be a start in getting these things cleaned up.

-John
[EMAIL PROTECTED]
Personal Opinion Only

Reply via email to