[Info-vax] RMS internals?

Hein, Nashua NH heinvandenheuvel at gmail.com
Tue Aug 11 16:51:05 EDT 2009


On Aug 11, 11:09 am, Howard S Shubs <how... at shubs.net> wrote:
>  "Hein, Nashua NH" <heinvandenheu... at gmail.com> wrote:
>

> I'm not sure what you're getting at.  I'm just looking at a simple
> situation of "read it, give the data to the caller".  I'm using $READ
> and $OPEN (and $CLOSE) so I don't have to open the file by hand, which
> would require me to play with ODS-2 myself, I expect.  

Which is just fine for a few MB. For larger volumes and higher
performance requirements you might want double/multy-buffering. RMS
record mode gives that for free, albeit with a 127 block IO size
limitation.

>> Disk $QIOs would be new to me, as well.

Not too tricky, but no need to go there. If you do, skip QIO and go
fro IO_PERFORM :-)

> I'm not seeing $MODIFY in either the System Services Reference or the
> RMS reference.  What is it, please?

Correct. You started with the word 'internal'. :-)
It is an undocumented system service primarily used by the linker/
debugger to switch form the fixed-length 512 image records to the
variable length system table section in the image file.

The (few) option are in RMEDEF.
One of its usages is to change the record format (RFM) on the fly.
If the file is opened for write, and you leave teh new setting, it
will become permanent.
Silly example usage to (potentially) 'fix' a broken backup saveset:

#include <stdio>
#include <rms>
#include <rmedef>
main (int argc, char *argv[])
{
struct FAB      fab;
int             s;
fab = cc$rms_fab;                       /* Make this a real FAB (bid
and bln) */
fab.fab$b_fac = FAB$M_PUT;
fab.fab$l_fna = argv[1];
fab.fab$b_fns = STRLEN( argv[1] );
s = sys$open(&fab);
    if (!(s & 1)) return s;
fab.fab$l_ctx = RME$C_SETRFM;
fab.fab$v_esc = 1;
if (argc > 2) {  sscanf(argv[2], "%d", &fab.fab$w_mrs );
    } else fab.fab$w_mrs = 32256;
fab.fab$b_rfm = FAB$C_FIX;
s=sys$modify(&fab);
    if (!(s & 1)) return s;
return sys$close(&fab);
}


> I'm reading up to 512 blocks at a time, or 3*recordsize rounded up to
> the next block size, whichever is bigger.  

Nice!

> A  256KB read is fairly modest, I figure.

Agreed. The SCSI protocol may still fragment it, but you did the best
you could :-). Out of your hands.

In a different reply Howard wrote:
>  There doesn't seem to be a STREAM CRLF variant. :-D

There is. It is plain 'stream' aka STM.
But be careful... it comes with some surprise semantics (to be RSTS/E
compatible?)

RMS REF MAN: FAB$B_RFM ... "Records are delimited by FF, VT, LF, or CR
LF,
and all leading zeros are ignored."

Hein.






More information about the Info-vax mailing list