LIB$CVT_BLOCKS_BYTES_64

Everything about buying, using, and managing OpenVMS systems not covered by other sections.
Post Reply

Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

LIB$CVT_BLOCKS_BYTES_64

Post by mberryman » Tue Jul 09, 2024 10:31 am

Would it be possible to get the argument list for the routine LIB$CVT_BLOCKS_BYTES_64? All of my attempts to guess have resulted in an accvio.

Thanks.


dgordon
VSI Expert
Valued Contributor
Posts: 51
Joined: Tue May 09, 2023 7:57 am
Reputation: 1
Status: Offline

Re: LIB$CVT_BLOCKS_BYTES_64

Post by dgordon » Tue Jul 09, 2024 12:30 pm

There's a reason it isn't documented. It's a hideous hack set up for code written in BLISS32. As far as I remember, the only consumer is DIRECTORY for certain rare cases that require quadword operations. I'm not surprised you couldn't guess it.

I am not responsible for this, I've only had to use it and didn't have time to replace it.

In C terms, the call looks like this:

LIB$CVT_BLOCKS_BYTES_64(int32 high_lw, int32 low_lw, int32 *output)

where
high_lw is the high longword of the quad you want converted,
low_lw is the low longword of the quad you want converted
output is a 3-longword array
output[0] is the "whole" part as an integer
output[1] is the "fractional" part as an integer
output[2] is the "counted string" text for the units. KB,MB,GB,TB,PB,EB,ZB so the low byte is 2 and the next two bytes are the
ASCII codes for the units.

Maximum supported size is 3.99 ZB. It's 1024-based.
Executive Vice President of InfoServer Engineering at VSI.

Post Reply