develooper Front page | perl.perl5.porters | Postings from July 2001

new exit tests on VMS

Thread Next
Craig A. Berry
July 25, 2001 15:55
new exit tests on VMS
Message ID:
The following recently added tests:


are currently failing on VMS.  At least one of the issues is that some of 
the tests expect a non-zero exit status from a child process to be preserved 
whole in the parent process upon return from running Perl from a system() 
call.  That would be the normal order of things on VMS if it weren't for the 
fact that the status value is shifted left by 8 bits.  My understanding is 
that there is some POSIX standard whereby the first byte has to be left free 
for the system to talk to itself about what it's doing to your program, so 
we emulate this behavior by doing the left shift.

But on VMS all 32 bits of a status value are significant, so if you did 
the shift by itself you would've just knocked a byte off the other end that 
you more than likely really needed to make sense of your status.  Charles 
Bailey's solution was to take the only field in the 32-bit structure that 
can be made sense of by itself (the severity bits) and keep only that.  The 
alternative was to have 24 bits of a 32-bit structure which, when shifted 
back right by 8 bits, would be just fine about 60% of the time but completely 
wrong about 40% of the time because of the lost byte.

I assume I will just have to skip these tests on VMS and try to document 
somewhere that using exit statuses the way these tests use them is 
non-portable, but I thought I would explain the situation and see if anyone 
has a better idea.

The complete structure of a VMS condition value is described here:


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About