Examples of $ZSETPRV()

Example:

    GTM> WRITE $ZSETPRV("TMPMBX")
    TMPMBX
    GTM>
    

This uses $ZSETPRV() to (attempt to) enable the TMPMBX privilege. The display from the WRITE command shows that the privilege was already enabled when the function executed.

Example:

    SET savprv=$ZSETPRV("SYSLCK")
    IF '$ZPRIVILEGE("SYSLCK") WRITE !,"Inadequate Privileges"
    ELSE DO ^%ST
    SET savprv=$ZSETPRV(savprv)    
    

This uses $ZSETPRV() to attempt to enable the SYSLCK privilege. Then $ZPRIVILEGE() checks to determine if the privilege was granted. This controls whether to issue a message or run the %ST utility program. Finally, the routine restores the original state of the SYSLCK privilege that was stored in savprv by again using $ZSETPRV().

VMS Privileges A

VMS PRIVILEGE

DESCRIPTION

ALLSPOOL

ALTPRI

ACNT

BUGCHK

BYPASS

Allocate a spooled device

Set/alter process priority

Create processes with no accounting

Make bugcheck error log entries

Bypass UIC-based protection

CMEXEC

CMKRNL

DETACH

DIAGNOSE

DOWNGRADE

Change mode to executive

Change mode to Kernel

Create detached processes

Diagnose devices

Downgrade classification

EXQUOTA

GROUP

GRPNAM

GRPPRV

LOG_IO

Exceed quotas

Group process control

Place name in group logical name table

Group access via system protection field

Perform logical I/O operations

MOUNT

NETMBX

OPER

PFNMAP

PHY_IO

Issue mount volume QIO

Create a network device

All operator functions

Map to section by physical page frame number

Perform physical I/O operations

PRMCEB

PRMGBL

PRMJNL

PRMMBX

PSWAPM

Create permanent common event flag clusters

Create permanent global sections

Create permanent journals

Create permanent mailboxes

Change process swap mode

READALL

SECURITY

SETPRV

SETALL

SHARE

Have read access to all files

Perform security functions

Set process privileges

Set all privileges

Assign channel to a non-shared device

SHMEM

SYSGBL

SYSLCK

SYSNAM

SYSPRV

Allocate memory structures shared by multiple processors

Create system global sections

Queue system-wide locks

Place name in system logical table

Access using the system protection mask

TMPMBX

UPGRADE

VOLPRO

WORLD

Create temporary mailboxes

Upgrade classification

Override volume protection

World process control