|
HP OpenVMS System Services Reference Manual
Setting the prmflg argument to nonzero changes
privilege bits in both the CURPRIV mask and the PROCPRIV mask.
prvprv
OpenVMS usage: |
mask_privileges |
type: |
quadword (unsigned) |
access: |
write only |
mechanism: |
by reference |
Privileges previously possessed by the calling process. The
prvprv argument is the address of a quadword bit
vector wherein each bit corresponds to a privilege that was previously
either enabled or disabled. If you do not specify
prvprv or assign it the value 0, the previous
privilege mask is not returned.
Description
The Set Privileges service enables or disables specified privileges for
the calling process.
The operating system maintains four separate privilege masks for each
process:
- AUTHPRIV---Privileges that the process is authorized to enable, as
designated by the system manager or the process creator. The AUTHPRIV
mask never changes during the life of the process.
- PROCPRIV---Privileges that are designated as permanently enabled
for the process. The PROCPRIV mask can be modified by $SETPRV.
- IMAGPRIV---Privileges with which the current image is installed.
- CURPRIV---Privileges that are currently enabled. The CURPRIV mask
can be modified by $SETPRV.
When a process is created, its AUTHPRIV, PROCPRIV, and CURPRIV masks
have the same contents. Whenever a system service (other than $SETPRV)
must check the process privileges, that service checks the CURPRIV mask.
When a process runs an installed image, the privileges with which that
image was installed are enabled in the CURPRIV mask. When the installed
image exits, the PROCPRIV mask is copied to the CURPRIV mask.
The $SETPRV service can set bits only in the CURPRIV and PROCPRIV mask,
but $SETPRV checks the AUTHPRIV mask to see whether a process can set
specified privilege bits in the CURPRIV or PROCPRIV masks.
Consequently, a process can give itself the SETPRV privilege only if
this privilege is enabled in the AUTHPRIV mask.
You can obtain each of a process's four privilege masks by calling the
$GETJPI (Get Job/Process Information) service and specifying the
desired privilege mask or masks as item codes in the
itmlst argument. You construct the item code for a
privilege mask by prefixing the name of the privilege mask with the
characters JPI$_ (for example, JPI$_CURPRIV is the item code
for the current privilege mask).
The DCL command SET PROCESS/PRIVILEGES also enables or disables
specified privileges; refer to the HP OpenVMS DCL Dictionary for details.
Required Access or Privileges
To set a privilege permanently, the calling process must be authorized
to set the specified privilege, or the process must be executing in
kernel or executive mode.
To set a privilege temporarily, one of the following three conditions
must be true:
- The calling process must be authorized to set the specified
privilege.
- The calling process must be executing in kernel or executive mode.
- The image currently executing must be one that was installed with
the specified privilege.
Required Quota
None
Related Services
$CANEXH, $CMKRNL, $CREPRC, $DCLEXH, $DELPRC, $EXIT, $FORCEX, $GETJPI,
$GETJPIW, $HIBER, $PROCESS_SCAN, $RESUME, $SETPRI, $SETPRN, $SETRWM,
$SUSPND, $WAKE
Condition Values Returned
SS$_NORMAL
|
The service completed successfully. All privileges were enabled or
disabled as specified.
|
SS$_NOTALLPRIV
|
The service completed successfully. Not all specified privileges were
enabled; see the Description section for details.
|
SS$_ACCVIO
|
The privilege mask cannot be read or the previous privilege mask cannot
be written by the caller.
|
SS$_IVSTSFLG
|
You specified a value other than 1 or 0 in either the
prmflg argument or the
enblfg argument.
|
$SETRWM
Allows a process to specify what action system services should take
when system resources required for their execution are unavailable.
Caution
Disabling resource waiting should be performed with caution, as doing
so can have unexpected effects on constituent sharable images and
runtime libraries.
|
Format
SYS$SETRWM [watflg]
C Prototype
int sys$setrwm ( char watflg);
Argument
watflg
OpenVMS usage: |
longword_unsigned |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Indicator specifying whether system services should wait for required
resources. The watflg argument is a longword value.
The value 0 (the default) specifies that system services should wait
until resources needed for their execution become available. The value
1 specifies that system services should return failure status
immediately when resources needed for their execution are unavailable.
The operating system enables resource wait mode for all processes. You
can disable resource wait mode only by calling $SETRWM.
If resource wait mode is disabled, it remains disabled until it is
explicitly reenabled or until the process is deleted.
Description
The Set Resource Wait Mode service allows a process to specify what
action system services should take when system resources required for
their execution are unavailable.
When resource wait mode is enabled, system services wait for the
required system resources to become available and then continue
execution. When resource wait mode is disabled, system services return
to the caller when required system resources are unavailable. The
condition value returned by $SETRWM indicates whether resource wait
mode was previously enabled or previously disabled.
The following system resources and process quotas are affected by
resource wait mode:
- System dynamic memory: nonpaged pool, lock manager dynamic
memory1
- UNIBUS adapter map registers
- Direct I/O limit (DIOLM) quota
- Buffered I/O limit (BIOLM) quota
- Buffered I/O byte count limit (BYTLM) quota
- Timer queue quota
- Mailbox buffer quota
- Insufficient pipe quota
Caution
Due to the process-wide implications of resource waiting, disabling
resource waiting should be performed with caution.
Disabling resource wait mode can have unexpected effects on libraries
or shareable images upon which your application may be directly or
indirectly dependent. If resource waiting is disabled, these
constituent libraries or shareable images may not perform as expected.
It is possible that these constituent components are coded to assume
resource waiting is enabled; therefore, they may not be coded to
receive various quota-related errors such as SS$_EXQUOTA.
Note that you should have full control over the entire program context
down to the system calls before disabling resource wait mode.
|
Required Access or Privileges
None
Required Quota
None
Related Services
$CANEXH, $CREPRC, $DCLEXH, $DELPRC, $EXIT, $FORCEX, $GETJPI, $GETJPIW,
$HIBER, $PROCESS_SCAN, $RESUME, $SETPRI, $SETPRN, $SETPRV, $SUSPND,
$WAKE
Condition Values Returned
SS$_WASCLR
|
The service completed successfully. Resource wait mode was previously
enabled.
|
SS$_WASSET
|
The service completed successfully. Resource wait mode was previously
disabled.
|
Note
1 Also, physical memory or system page
table entries under rare circumstances.
|
$SETSHLV
Controls whether a process automatically unshelves files.
Format
SYS$SETSHLV [pidadr] ,[prcnam] ,[shlvflg]
C Prototype
int sys$setshlv (unsigned int *pidadr, void *prcnam, unsigned int
shlvflg);
Arguments
pidadr
OpenVMS usage: |
process_id |
type: |
longword (unsigned) |
access: |
modify |
mechanism: |
by reference |
Process identification (PID) of the process. The
pidadr argument is the address of the PID. The
pidadr argument can only refer to a process running on
the local node. You cannot modify a process on a remote node.
You must specify the pidadr argument to modify a
process whose UIC group number is different from that of the calling
process.
prcnam
OpenVMS usage: |
process_name |
type: |
character--coded text string |
access: |
read only |
mechanism: |
by descriptor--fixed-length string descriptor |
Process name of the process. The prcnam argument is
the address of a character string descriptor pointing to the process
name. You identify a process with a 1- to 15-character string.
You can only use the prcnam argument to modify a
process in the same UIC group as the calling process. To modify a
process in another UIC group, you must specify the
pidadr argument.
shlvflg
OpenVMS usage: |
longword_unsigned |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Value specifying whether automatic unshelving is to be turned on or
off. The shlvflg argument is a longword containing
this value. The value 0 turns automatic unshelving on. The value 1
turns automatic unshelving off.
Description
The Set Automatic Unshelving service controls whether a process
automatically unshelves files.
The pidadr and prcnam default to the
current process. If the longword at address pidadr is
0, the PID of the target process is returned.
The setting for automatic unshelving is inherited by subprocesses.
The DCL command SET PROCESS/[NO]AUTOUNSHELVE also controls automatic
unshelving for a process; refer to the HP OpenVMS DCL Dictionary for details.
Required Access or Privileges
Depending on the operation, the calling process might need one of the
following privileges to use $SETSHLV:
- GROUP privilege to modify a process in the same group, unless the
target process has the same UIC as the calling process.
- WORLD privilege to modify any process in the system.
Required Quota
None
Related Services
$GETJPI
Condition Values Returned
SS$_WASCLR
|
The service completed successfully. Automatic unshelving was previously
on.
|
SS$_WASSET
|
The service completed successfully. Automatic unshelving was previously
off.
|
SS$_ACCVIO
|
An argument was not accessible by the caller.
|
SS$_BADPARAM
|
The
shlvflg argument was invalid.
|
SS$_IVLOGNAM
|
The
prcnam argument was invalid. The process name string
had either 0 characters or more than 15 characters.
|
SS$_NONEXPR
|
The specified process did not exist, or the specified process
identification was invalid.
|
SS$_NOPRIV
|
The caller did not have the privilege to modify other processes.
|
SS$_REMOTE_PROC
|
The specified process was not on the local node. The service cannot
modify a process on a remote node.
|
$SETSTK
Allows a process to change the size of its supervisor, executive, and
kernel stacks by altering the values in the stack limit for a memory
stack and base arrays held in P1 (per-process) space.
Format
SYS$SETSTK inadr ,[retadr] ,[acmode]
C Prototype
int sys$setstk (struct _va_range *inadr, struct _va_range *retadr,
unsigned int acmode);
Arguments
inadr
OpenVMS usage: |
address_range |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by reference |
Range of addresses that express the stack's new limits. The
inadr argument is the address of a 2-longword array
containing, in order, the address of the top of the stack and the
address of the base of the stack. Because stacks in P1 space expand
from high to low addresses, the address of the base of the stack must
be greater than the address of the top of the stack.
retadr
OpenVMS usage: |
address_range |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by reference |
Range of addresses that express the stack's previous limits. The
retadr argument is the address of a 2-longword array
into which $SETSTK writes, in the first longword, the previous address
of the top of the stack and, in the second longword, the previous
address of the base of the stack.
acmode
OpenVMS usage: |
access_mode |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Access mode of the stack to be altered. The acmode
argument is a longword containing the access mode. The $PSLDEF macro
defines symbols for the four access modes. The most privileged access
mode used is the access mode of the caller.
If acmode specifies user mode, $SETSTK performs no
operation and returns the SS$_NORMAL condition value.
Description
The Set Stack Limits service allows a process to change the size of its
supervisor, executive, and kernel stacks by altering the values in the
stack limit and base arrays held in P1 (per-process) space.
Required Access or Privileges
The calling process can adjust the size of stacks only for access modes
that are equal to or less privileged than the access mode of the
calling process.
Required Quota
None
Related Services
$ADJSTK, $ADJWSL, $CRETVA, $CRMPSC, $DELTVA, $DGBLSC, $EXPREG, $LCKPAG,
$LKWSET, $MGBLSC, $PURGWS, $SETPRT, $SETSWM, $ULKPAG, $ULWSET, $UPDSEC,
$UPDSECW
Condition Values Returned
SS$_NORMAL
|
The service completed successfully.
|
SS$_ACCVIO
|
The input address array cannot be read by the caller; the input range
is invalid; or the return address array cannot be written by the caller.
|
$SETSTK_64 (Alpha and I64)
On Alpha and I64 systems, allows a process to change the size of its
supervisor, executive, and kernel stacks by altering the values in the
stack limit for a memory stack or a register stack and base arrays held
in P1 (per-process) space.
Format
SYS$SETSTK_64 start_va_64 ,length_64 ,acmode, flags, prev_start_va,
prev_length
C Prototype
int sys$setstk_64 (void *start_va_64, unsigned __int64 length_64,
unsigned int acmode, unsigned int flags, void ** prev_start_va_64,
unsigned __int64 * prev_length_64);
Arguments
start_va_64
OpenVMS usage: |
address |
type: |
quadword address |
access: |
read only |
mechanism: |
by value |
Lowest address in range of addresses that express the stack's new
limits. For a memory stack, this address is the stack limit. For an I64
register stack, this address is the stack base.
length_64
OpenVMS usage: |
length |
type: |
quadword (unsigned) |
access: |
read only |
mechanism: |
by value |
Length of the range of addresses that express the stack's new limits.
acmode
OpenVMS usage: |
access_mode |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Access mode of the stack to be altered. The acmode
argument is a longword containing the access mode. The $PSLDEF macro
defines symbols for the four access modes. The most privileged access
mode used is the access mode of the caller.
If acmode specifies user mode, $SETSTK_64 performs no
operation and returns the SS$_NORMAL condition value.
flags
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
0 for memory stack (Alpha and I64) VA$M_SETSTK_REGISTER for register
stack (I64 only)
The $VADEF macro and VADEF.H file define symbolic names for the
flags argument.
prev_start_va_64
OpenVMS usage: |
address |
type: |
quadword address |
access: |
write only |
mechanism: |
by reference |
Lowest address in the range of addresses that express the stack's
previous limits. For a memory stack, this address was the stack limit.
For an I64 register stack, this address was the stack base.
prev_length_64
OpenVMS usage: |
length |
type: |
quadword |
access: |
write only |
mechanism: |
by reference |
Length of the range of addresses that express the stack's previous
limits.
Description
The Set Stack Limits service allows a process to change the size of its
supervisor, executive, and kernel stacks by altering the values in the
stack limit and base arrays held in P1 (per-process) space. For Alpha,
only the memory stack limits can be changed. The address range must be
within 32-bit address space. For IA64, either the memory stack or
register stacklimits can be changed. The address range for the register
stack can be in 64-bit address space.
Required Access or Privileges
The calling process can adjust the size of stacks only for access modes
that are equal to or less privileged than the access mode of the
calling process.
Required Quota
None
Related Services
$ADJSTK, $ADJWSL, $CRETVA_64, $DELTVA_64, $DGBLSC, $EXPREG_64,
$LCKPAG_64, $LKWSET_64, $MGBLSC_64, $PURGWS, $SETPRT_64, $ULKPAG_64,
$ULWSET_64, $UPDSEC_64, $UPDSECW_64
Condition Values Returned
SS$_NORMAL
|
The service completed successfully.
|
SS$_ACCVIO
|
The prev_start_va_64 or prev_length_64 argument cannot be written by
the caller.
|
SS$_LENVIO
|
Memory stack limits were specified in 64-bit address space. Only 32-bit
addresses are supported for the memory stack limits.
|
|