[Deutsche Version]

Undocumented OpenVMS: SYS$GETENV/SYS$SETENV

These are two undocumented system services, which allow you to access console variables in a similar way as the lexical f$getenv allows you read access from DCL. You can only access predefined variables with these services. Both services have one argument, the address of an item list containing special item_3 descriptors. Every descriptor contains the item value of the requested variable (a longword), the length of the working storage (longword), a pointer to working storage containing or receiving the variable's value (a quadword), and a pointer to a longword holding the actual length of the obtained value (quadword). The module $STENVDEF contains a list of all known item codes as well as a descriptor offset definition. No privs are needed to obtain the values, but CMKRNL priv is needed to set or change values.

Most probably these are available since OpenVMS 6.1 on the Alpha platform.

Hoff (Stephen) Hoffman made some example code for this available. To quote him:

The attached example C code does not use documented or supported interfaces, and -- like any other kernel code -- it might just crash your OpenVMS system, and it might require a rebuild after an ECO or upgrade.

Still, if you do want to explore these functions the following code might provide a usefull starting point.

 Valid CSS! [HTML 4.0 Checked!] [Viewable With Any Browser]

Comments to: Martin P.J. Zinser
Last modified: 20020628