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

new exit tests on VMS

Thread Next
From:
Craig A. Berry
Date:
July 25, 2001 15:55
Subject:
new exit tests on VMS
Message ID:
5.1.0.14.0.20010724152128.01b90370@exchi01
The following recently added tests:

lib/Test/Simple/t/exit.t
lib/Test/Simple/t/simple.t

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:

<http://www.openvms.compaq.com/doc/73final/5973/5973pro_012.html#4512_condition_format>






Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About