$! ********************************************************************** $! * PUP: Raise base priority of a process by one. * $! * User will be asked to confirm if base priority would be * $! * greater than four. * $! * * $! * 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") $ New_Priority = Current_Priority + 1 $ If New_Priority .GT. 4 Then - GoSub Confirm $ Set Process/Priority='New_Priority'/ID='PID' $ Write SYS$OUTPUT "Base priority increased 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 "%PUP-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 $! $! ********************************************************************** $! * Confirm: Confirm raising priority over 4. * $! ********************************************************************** $ Confirm: $ Write SYS$OUTPUT "Raising the priority of this process would yield a base priority of ''New_Priority'." $ Get_Answer: $ Inquire/NoPunc Answer "Raise priority anyway [N]? " $ If Answer .EQS. "" Then - Answer = "N" $ Answer = F$Extract(0,1,F$Edit(Answer,"Trim,UpCase")) $ If Answer .EQS. "N" Then Exit $ If Answer .NES. "Y" Then Goto Get_Answer $ Return