$! ********************************************************************** $! * PDOWN: Lower base priority of a process by one. Note that 0 is * $! * the lowest possible base priority. * $! * * $! * Specify the target process id as P1. If no process is * $! * specified, the current process is used. * $! * * $! * This software has been released into public domain. This * $! * software may be freely copied, distributed, and modified so * $! * long as it contains this message. This software is provided * $! * as is, free of charge. The author assumes no responsibility * $! * or liability for the use of this software. * $! * * $! * Richware http://richj.home.mindspring.com/Richware * $! * * $! * 11/9/92 RDJ Command Procedure Creation. * $! ********************************************************************** $! $ On Error Then Exit $ On Warning Then Exit $ GoSub Check_Privs $ GoSub Check_Params $! $ Current_Priority = F$GetJPI(PID,"PriB") $ If Current_Priority .EQ. 0 $ Then $ Write SYS$OUTPUT "Current priority is already 0." $ Goto Exit $ EndIf $ New_Priority = Current_Priority - 1 $ Set Process/Priority='New_Priority'/ID='PID' $ Write SYS$OUTPUT "Base priority decreased to ''New_Priority'." $ Exit: $ Set Process/Priv=('Old_Privs') $ Exit $! $! ********************************************************************** $! * Check_Privs: Check for sufficient privilege. * $! ********************************************************************** $ Check_Privs: $ If P1 .EQS. "" Then Return $ Old_Privs = F$SetPrv("WORLD") $ If .NOT. F$Priv("WORLD") $ Then $ Write SYS$OUTPUT "%PDOWN-E-NOPRIV, Insufficient privileges" $ Exit $ EndIf $ Return $! $! ********************************************************************** $! * Check_Params: Check for proper parameters. * $! ********************************************************************** $ Check_Params: $ If P1 .EQS. "" $ Then PID = F$GetJPI("","PID") $ Else $ PID = P1 $ EndIf $ Return