10-Jan-2014

VMS$BUFFER_OBJECT_USER

A few pieces of code on this site use buffered objects for fast I/O. For example, this programming example.

Comments in the code note that you must have the VMS$BUFFER_OBJECT_USER identifier granted to your process or the code will fail to run. This is all nicely documented in various manuals on the documentation set, probably most comprehensively in this section of the "Programming Concepts Manual".

But:


$ show proc/rights

10-JAN-2014 13:06:45.09   User: XXX              Process ID:   20202096
                          Node: XXXXXX            Process name: "xxx"

Process rights:
 XXX                               resource
 INTERACTIVE
 REMOTE
 DBG$ENABLE_SERVER
 VMS$MEM_RESIDENT_USER
 VMS$BUFFER_OBJECT_USER

System rights:
 SYS$NODE_XXXXXX

Soft CPU Affinity: off
$ run test
sys$create_bufobj claims you don't have the VMS$BUFFER_OBJECT_USER identifier!
$

The code for the test program is the minimum required to allocate some memory and turn it into a buffer object. Here's the C:


#define __NEW_STARLET 1

#include <stdio.h>
#include <stdlib.h>
#include <ssdef.h>
#include <stsdef.h>
#include <va_rangedef.h>
#include <gen64def.h>
#include <lib$routines.h>
#include <starlet.h>

#define errchk_sig(arg) if (!$VMS_STATUS_SUCCESS(arg)) (void)lib$signal (arg)


/******************************************************************************/
int main (void) {

static VA_RANGE buffer_ia;
static VA_RANGE buffer_oa;
static GENERIC_64 buffer_handle;

static int r0_status;


    r0_status = sys$expreg (1,
                            &buffer_ia,
                            0,
                            0);
    errchk_sig (r0_status);

    r0_status = sys$create_bufobj (&buffer_ia,
                                   &buffer_oa,
                                   0,
                                   0,
                                   &buffer_handle);
    if ((r0_status & 1) == 1) {
        (void)printf ("Buffer object created successfully\n");

        r0_status = sys$delete_bufobj (&buffer_handle);
        errchk_sig (r0_status);
    } else {
        if (r0_status == SS$_NOBUFOBJID) {
            (void)printf ("sys$create_bufobj claims you don't have "
                          "the VMS$BUFFER_OBJECT_USER identifier!\n");
        } else {
            errchk_sig (r0_status);
        }
    }

    r0_status = sys$deltva (&buffer_ia, 0, 0);
    errchk_sig (r0_status);
}

After a bit of experimentation, it appears that the only value of the identifier that will work correctly is %X80000008. Any value other than this causes the code to emit the (what I'd have to call incorrect) error.

I'll report this to Engineering and see what they say...

Posted at January 10, 2014 1:19 PM
Tag Set:
Comments

I have found one com-file that installs the identifier:

SYS$SYSTEM:I64VMS$PCSI_INSTALL.COM

contains:

$uaf add/identifier vms$buffer_object_user/value:identifier:8

Eberhard

Posted by: Eberhard Heuser at January 10, 2014 11:19 PM

Yep, it's in SYS$SYSTEM:AXPVMS$PCSI_INSTALL.COM on the Alpha side too.

I still have an issue with the fact that the documentation says "Must hold the identifier" and never mentions it needs to be a specific value, however.

Try doing a HELP/MESSAGE NOBUFOBJID. In the situation where the identifier is the wrong value, this text is absolutely no help to an inexperienced systems manager.

Posted by: Jim Duff at January 11, 2014 4:48 AM

Comments are closed