(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: SETPRV, next: SETUAI)


SETSWM - Set Process Swap Mode


Format:
    oldflg = vms_sys.setswm ([swpflg])
Returns:
oldflg
This is the 'condition value returned' from the system service. The values of 'SS$_WASSET' or 'SS$_WASCLR' are returned as numbers 0 or 1 - other conditions result in a Python exception.
Arguments:
swpflg
Indicator specifying whether the process can be swapped.
Examples:
$ SET PROCESS/PRIVILEGE=PSWAPM

>>> import vms_sys

>>> # 1= disable swapping
>>> vms_sys.setswm (1)
0

>>> # 0= enable swapping
>>> vms_sys.setswm (0)
1
>>> vms_sys.setswm (0)
0

>>> # None = disable swapping
>>> vms_sys.setswm (None)
0
>>> # 0= enable swapping
>>> vms_sys.setswm (0)
1

>>> vms_sys.setswm ()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: function requires exactly 1 argument; 0 given

>>> vms_sys.setswm ('X')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: swpflg must be integer or None


$ SET PROCESS/PRIVILEGE=NOPSWAPM
...
>>> vms_sys.setswm (0)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (36, '%SYSTEM-F-NOPRIV, insufficient privilege or object\
 protection violation')
>>>

(go to: table of contents, index, list of vms_sys, prev: SETPRV, next: SETUAI)

28-SEP-1998 ZE.