Problem with VMS_SUPPORT.C
B. Z. Lederman
lederman at Encompasserve.org
Wed Mar 26 16:42:09 GMT 2003
I've been trying out the 2.2.7A kit on OpenVMS 7.3-1, and I've
noticed a problem I don't think I've seen mentioned here.
In the log.* file, I noticed there was a $GETDVI error after
every file accessed. So I looked around the source for where it
came from, and I see that the system call isn't coded properly in
VMS_SUPPORT.C
sts = sys$getdvi(0,0,&dev,&dvi_itm,iosb,0,0,0);
I think should be
sts = sys$getdviw(0,0,&dev,&dvi_itm,&iosb,0,0,0);
The "wait" version should be used to make sure the information
comes back before the program proceeds to use it. Also, I think
the addressing mode on the I/O status block was wrong. (I'm also
not thrilled with the declaration of iosb, but that's a separate
issue.)
However, this doesn't fix the underlying problem. If you look
at the error code, it translates to "invalid device name". If
you look at where "dev" is filled in, it calls vms_get_filespec,
which includes an entire file name specification. I checked the
manual, and the item codes being requested for GETDVI, MAXBLOCKS,
FREEBLOCKS, and MAXFILES, apply only to devices, and not files.
(Actually, I believe all of GETDVI applies only to devices and
not files.) So before calling GETDVI you need to strip off
everything but the device specification.
Even so, this code doesn't make obvious sense to me. Why
would you need to retrieve this information when reading files?
I can see wanting to know how much free space remains on the disk
before trying to WRITE a file, but none of this is needed when
reading a file, and only FREEBLOCKS is of any use in telling you
if there is sufficient space to write a new file. It seems to me
that SAMBA is doing a lot of unnecessary work here.
Suggestions?
Bart.
More information about the samba-vms
mailing list