[Info-vax] VMS process communication

Arne Vajhøj arne at vajhoej.dk
Wed Oct 5 19:26:29 EDT 2022


On 10/5/2022 7:06 PM, Arne Vajhøj wrote:
> I also had problems with the buffers. $ICC_TRANSMITW
> has a SEND_BUF and $ICC_RECEIVEW has a RECV_BUF but they
> are declared as $DEFPTR and UNSIGNED. That gave my problems with
> transmit so I changed SEND_BUF to also be UNSIGNED.

Let me elaborate on this.

The sys$libary:starlet.pas definition is:
   SEND_BUF : $DEFPTR;

And I cannot get that to work.

I am probably missing something very basic, but ...

Demo:

$ type zb.c
#include <stdio.h>

void f(unsigned char *s)
{
    printf("%02X %02X %02X %02X %02X %02X %02X %02X\n", s[0], s[1], 
s[2], s[3], s[4], s[5], s[6], s[7]);
}
$ cc zb
$ type za.pas
program za(input,output);

type
   $DEFTYP = [UNSAFE] INTEGER;
   $DEFPTR = [UNSAFE] ^$DEFTYP;

[external('F')] procedure f1(%IMMED s : unsigned); external;
[external('F')] procedure f2(s : $DEFPTR); external;
[external('F')] procedure f3(%IMMED s : $DEFPTR); external;

var
    s : varying [255] of char;

begin
    s := 'ABCDEF' + chr(0);
    f1(iaddress(s.body));
    f2(s.body);
    f2(iaddress(s.body));
    f3(s.body);
    f3(iaddress(s.body));
end.
$ pas za
$ link za + zb
$ run za
41 42 43 44 45 46 00 00
41 42 43 44 00 00 00 00
CA 79 E2 7A 00 00 00 00
00 00 00 00 00 00 00 00
41 42 43 44 45 46 00 00

Especially:
    f2(s.body);
output puzzles me.

Arne








More information about the Info-vax mailing list