COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    1
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00001      0  0 [ inherit ( 'sys$library:starlet.pen' ) ] 
00002      0  0 PROGRAM com_killer ( input, output, f ) ;
00003      0  0  
00004   C  0  0 {
00005   C  0  0 PROGRAM DESCRIPTION: 
00006   C  0  0 
00007   C  0  0 This program lowers the base priority of terminal users that have spent
00008   C  0  0 too much of their time in COM state.  At each interval it will lower
00009   C  0  0 their priority by one if they have spent MAX_CPUTIM percent of their
00010   C  0  0 time using the CPU.  Also, if they have been found more than MAX_COM_STATE
00011   C  0  0 times in COM or COMO state they will be lowered.  It will raise them back 
00012   C  0  0 up to their authorized priority if they have used less than MAX_CPUTIM of 
00013   C  0  0 their time using the CPU AND they are not currently in COM or COMO state.  
00014   C  0  0 This is designed to discourage terminal users from executing jobs at 
00015   C  0  0 their terminal that should really be done in a batch job.  This should 
00016   C  0  0 be executed as follows:
00017   C  0  0 
00018   C  0  0 $RUN COM_KILLER/PRIORITY=6/OUTPUT=SYS$MANAGER:COM_KILLER/DETACHED -
00019   C  0  0      /PROCESS_NAME="COM_KILLER"/WORK=200
00020   C  0  0 
00021   C  0  0 under the SYSTEM account.
00022   C  0  0 
00023   C  0  0 AUTHORS: 
00024   C  0  0  
00025   C  0  0     Brent Dunlock
00026   C  0  0  
00027   C  0  0 CREATION DATE:	04-APR-87
00028   C  0  0  
00029   C  0  0  
00030   C  0  0 	    C H A N G E   L O G
00031   C  0  0  
00032   C  0  0      Date     |   Name  | Description
00033   C  0  0 --------------+---------+-------------------------------------------------------
00034   C  0  0  04/15/87     |   khaaw |  Original writing
00035   C  0  0  05/10/87     |   khaaw |  Version 1.0 - original version
00036   C  0  0  06/11/87     |   khaaw |  Version 1.1 - modified static variables
00037   C  0  0  02/11/88     |   khaaw |  Version 1.2 - increased max_users to 320,
00038   C  0  0                                   modified code to handle com count.
00039   C  0  0  06/23/88     |   khaaw |  Version 1.3 - close the immune file
00040   C  0  0  28-NOV-88    |   khglw |  Version 1.4 - added shutdown code
00041   C  0  0  10-APR-89    |   kxbld |  Version 1.5 - add check for detached jobs
00042   C  0  0 --------------+---------+-------------------------------------------------------
00043   C  0  0 }
00044      0  0 
00045      0  0  const
00046      0  0 
00047   C  0  0 { holds list of immune users }
00048      0  0   immune_file =	    'sys$manager:nobump.dat';
00049      0  0 
00050   C  0  0 { com_killer log file }
00051      0  0   log_file =	    'sys$manager:com_killer.log';
00052      0  0 
00053      0  0   proc_name = 'COM_KILLER'; {process name of this process when running}
00054      0  0   wait_time = 15.0;   { interval wait time in seconds }
00055      0  0   max_users = 320;    { set to maximum number of users }

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    2
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00056      0  0   max_cputim = 70.0;  { maximum percent of cpu time per interval }
00057      0  0   max_com_state = 12; { maximum number of times user can be found in com state }
00058   C  0  0 		      { regardless of percent cpu used.  This is because on
00059   C  0  0 		      { a very busy system a user may not get max_cputim  }
00060   C  0  0 		      { percent of the cpu. So, we'll lower them anyway. }
00061      0  0 
00062      0  0   sch$c_com = 12;     { COM state }
00063      0  0   sch$c_como = 13;    { COMO state }
00064      0  0 
00065      0  0   access_mode = 0;    { mailbox access mode }
00066      0  0   buffer_quota = 256; { mailbox buffer quota }
00067      0  0   max_message = 256;  { return error message length }
00068      0  0   max_transfer = 4096;{ maximum transfer for mailbox}
00069      0  0   permanent_flag = 1; { flag that determines of mailbox is permanen 1=yes }
00070      0  0   protection_mask = 0;{ protection of writing to the mailbox }
00071      0  0   max_string_length = 256; { maximum length of the mailbox message }
00072      0  0 
00073      0  0  type
00074      0  0   $uword = [word] 0..65535;
00075      0  0   Username_String = packed array[1..12] of char;
00076      0  0   Terminal_String = packed array[1..7] of char;
00077      0  0   Unsigned_Word = [ word ] 0 .. 65535;
00078      0  0   Jpi_Item = [ byte ( 12 ) ]
00079      0  0 
00080      0  0   record
00081      0  0     Buffer_Length : [ pos ( 0 ) ] Unsigned_Word;
00082      0  0     Item_Code : [ pos ( 16 ) ] Unsigned_Word;
00083      0  0     Buffer_Address : [ pos ( 32 ) , unsafe ]  unsigned;
00084      0  0     Return_Length_Address : [ pos ( 64 ) ]  unsigned;
00085      0  0    end;
00086      0  0 
00087      0  0   Jpi_Item_List = record
00088   C  0  0     { Item list }
00089      0  0     list : packed array[1..9] of Jpi_Item;
00090      0  0 
00091   C  0  0     { Longword to be set to zero to signal end of list }
00092      0  0     terminator : integer;
00093      0  0    end;
00094      0  0 
00095      0  0   User_list_type = record
00096      0  0     cputim : integer;
00097      0  0     pid : integer;
00098      0  0     com_count : integer; { count of times we've found user in com state}
00099      0  0    end;
00100      0  0   
00101      0  0   string          = varying [max_string_length] of char;
00102      0  0   message_string  = packed array [1..max_string_length] of char;
00103      0  0 
00104      0  0   io_status_block = record
00105      0  0                     status     : $uword; 
00106      0  0                     byte_count : $uword;
00107      0  0                     pid        : unsigned;
00108      0  0                     end;
00109      0  0 
00110   C  0  0 { global variables }

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    3
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00111      0  0  var
00112      0  0   f : text;
00113      0  0   date_string,time_string : packed array [1..11] of char;
00114      0  0   Id_item : Jpi_Item_List;
00115      0  0   Id_Length : unsigned;
00116      0  0   Id : Username_String;
00117      0  0   Cputim_length : unsigned;
00118      0  0   Cputim : integer;
00119      0  0   PID_length : unsigned;
00120      0  0   PID : integer;
00121      0  0   Prib_length : unsigned;
00122      0  0   Prib : integer;
00123      0  0   Proc_State_length : unsigned;
00124      0  0   Proc_State : integer;
00125      0  0   Authpri_length : unsigned;
00126      0  0   Authpri : integer;
00127      0  0   Owner_length : unsigned;
00128      0  0   Owner : integer;
00129      0  0   Terminal_length : unsigned;
00130      0  0   Terminal : Terminal_String;
00131      0  0   jobtype : integer;
00132      0  0   jobtype_length : unsigned;
00133      0  0   Status : unsigned;
00134      0  0   Request_pid : unsigned;
00135      0  0   User_list : array[1..max_users] of User_list_type;
00136      0  0   Proc_count : integer;
00137      0  0   Interval_tics : real;
00138      0  0   delta_cputim : real;
00139      0  0   percent_cputim : real;
00140      0  0   immune_count : integer;
00141      0  0   immune_users : array[1..20] of Username_String;
00142      0  0   done : boolean;
00143      0  0 
00144      0  0   channel         : [volatile] $uword;
00145      0  0   stop            : [volatile] boolean;
00146      0  0   msg_length      : $uword;
00147      0  0   message         : message_string;
00148      0  0   mailbox_message : [volatile] string;
00149      0  0   mbx_msg_length  : [volatile] $uword;
00150      0  0   f1              : [volatile] text;
00151      0  0   today,hour      : packed array[1..11] of char;
00152   C  0  0 {-----------------------------------------------------------------------------}
00153      0  0 
00154      1  0  [asynchronous,external] function lib$wait 
00155      0  0   (SECONDS : real) : unsigned; external;
00156   C  0  0 { wait some number of seconds }
00157      0  0 
00158   C  0  0 {-----------------------------------------------------------------------------}
00159      0  0 
00160      1  0  procedure Initialize;
00161   C  1  0  { Get the items of information we need for each user }
00162      1  0 
00163      1  0  var
00164      1  0   i : integer;
00165      1  0 

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    4
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00166      1  1  begin
00167      1  1     with Id_Item do
00168      1  2    begin
00169      1  2     List[1].Buffer_Length := 12;
00170      1  2     List[1].Item_Code := JPI$_USERNAME;
00171      1  2     List[1].Buffer_Address := iaddress(Id);
00172      1  2     List[1].Return_Length_Address := iaddress(Id_Length);
00173      1  2     List[2].Buffer_Length := 4;
00174      1  2     List[2].Item_Code := JPI$_CPUTIM;
00175      1  2     List[2].Buffer_Address := iaddress(Cputim);
00176      1  2     List[2].Return_Length_Address := iaddress(Cputim_Length);
00177      1  2     List[3].Buffer_Length := 4;
00178      1  2     List[3].Item_Code := JPI$_PID;
00179      1  2     List[3].Buffer_Address := iaddress(PID);
00180      1  2     List[3].Return_Length_Address := iaddress(PID_Length);
00181      1  2     List[4].Buffer_Length := 4;
00182      1  2     List[4].Item_Code := JPI$_PRIB;
00183      1  2     List[4].Buffer_Address := iaddress(PRIB);
00184      1  2     List[4].Return_Length_Address := iaddress(PRIB_Length);
00185      1  2     List[5].Buffer_Length := 4;
00186      1  2     List[5].Item_Code := JPI$_STATE;
00187      1  2     List[5].Buffer_Address := iaddress(Proc_State);
00188      1  2     List[5].Return_Length_Address := iaddress(Proc_State_Length);
00189      1  2     List[6].Buffer_Length := 4;
00190      1  2     List[6].Item_Code := JPI$_AUTHPRI;
00191      1  2     List[6].Buffer_Address := iaddress(Authpri);
00192      1  2     List[6].Return_Length_Address := iaddress(Authpri_Length);
00193      1  2     List[7].Buffer_Length := 4;
00194      1  2     List[7].Item_Code := JPI$_OWNER;
00195      1  2     List[7].Buffer_Address := iaddress(Owner);
00196      1  2     List[7].Return_Length_Address := iaddress(Owner_Length);
00197      1  2     List[8].Buffer_Length := 7;
00198      1  2     List[8].Item_Code := JPI$_TERMINAL;
00199      1  2     List[8].Buffer_Address := iaddress(Terminal);
00200      1  2     List[8].Return_Length_Address := iaddress(Terminal_length);
00201      1  2     List[9].Buffer_Length := 4;
00202      1  2     List[9].Item_Code := JPI$_JOBTYPE;
00203      1  2     List[9].Buffer_Address := iaddress(jobtype);
00204      1  2     List[9].Return_Length_Address := iaddress(Jobtype_length);
00205      1  2     Terminator := 0;
00206      1  1    end; { of with }
00207      1  1 
00208   C  1  1 { set the seconds to wait and interval }
00209      1  1   interval_tics := wait_time * 100.0;
00210      1  1 
00211   C  1  1 { open the log file }
00212      1  1   open(file_name:=log_file,file_variable:=f1);
00213      1  1   rewrite(f1);
00214      1  1 
00215   C  1  1 { Find the list of immune users }
00216      1  1   immune_count := 1;
00217      1  1   open(file_variable := f,
00218      1  1        file_name := immune_file,
00219      1  1        history := OLD);
00220      1  1   reset(f);

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    5
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00221      1  1   while not eof(f) do
00222      1  2    begin
00223      1  2     readln(f, immune_users[immune_count]);
00224      1  2     writeln(f1,'Immune user = ',immune_users[immune_count]);
00225      1  2     immune_count := immune_count + 1;
00226      1  1    end;
00227      1  1   close (f);
00228      1  1 
00229   C  1  1 { zero out the user counters }
00230      1  1   for i := 1 to max_users do
00231      1  2    begin
00232      1  2     user_list[i].cputim := 0;
00233      1  2     user_list[i].pid := 0;
00234      1  2     user_list[i].com_count := 0;
00235      1  1    end;
00236      1  1 
00237      0  0  end; { of Initialize }
00238      0  0 
00239   C  0  0 {-----------------------------------------------------------------------------}
00240      0  0 
00241      1  0  procedure lower_priority (pid : unsigned);
00242   C  1  0 { Lower the priority by one unless they are already at priority one. }
00243   C  1  0 { Also, reset their com state count to start the count over again. }
00244      1  0 
00245      1  0 var
00246      1  0  dummy, new_priority : unsigned;
00247      1  0 
00248      1  1  begin
00249      1  1   user_list[proc_count].com_count := 0; { reset com state count }
00250      1  1   if (prib > 1) and (prib <= authpri) then
00251      1  2    begin
00252      1  2    new_priority := prib - 1;
00253      1  2    dummy := $setpri(pid,,new_priority);
00254      1  2    if (dummy <> ss$_normal) then
00255      1  2     writeln(f1,'Bad status for $setpri = ',dummy:1)
00256      1  2    else
00257      1  3     begin
00258      1  3     date(date_string);
00259      1  3     time(time_string);
00260      1  3     write(f1,date_string,' - ',time_string,' : ');
00261      1  3     writeln(f1,'Lowered priority of ', hex(pid),' ',Id:12,' to ',new_priority:1);
00262      1  2     end;
00263      1  1    end;
00264      0  0  end; { of lower_priority }
00265      0  0 
00266   C  0  0 {-----------------------------------------------------------------------------}
00267      0  0 
00268      1  0  procedure raise_priority (pid : unsigned);
00269   C  1  0 { Raise the priority to their authorized base priority }
00270      1  0 
00271      1  0 var 
00272      1  0  dummy : unsigned;
00273      1  0 
00274      1  1  begin
00275      1  1   dummy := $setpri(pid,,authpri);

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    6
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00276      1  1   if (dummy <> ss$_normal) then
00277      1  1    writeln(f1,'Bad status for $setpri = ',dummy:1)
00278      1  1   else
00279      1  2    begin
00280      1  2    date(date_string);
00281      1  2    time(time_string);
00282      1  2    write(f1,date_string,' - ',time_string,' : ');
00283      1  2    writeln(f1,'Raised  priority of ', hex(pid),' ',Id:12,' to ',authpri:1);
00284      1  1    end;
00285      0  0  end;
00286      0  0 
00287   C  0  0 {-----------------------------------------------------------------------------}
00288      0  0 
00289      1  0  function immune : boolean;
00290   C  1  0 { This function checks the list if immune users against the current Id. }
00291      1  0 
00292      1  0   var
00293      1  0    i : integer;
00294      1  0 
00295      1  1  begin
00296      1  1   immune := false;
00297      1  1   for i := 1 to immune_count do
00298      1  1    if (Id = immune_users[i]) then
00299      1  1     immune := true;
00300      0  0  end;
00301      0  0 
00302   C  0  0 {-----------------------------------------------------------------------------}
00303      0  0 
00304      1  0  procedure process_a_user;
00305      1  0 
00306      1  1  begin
00307      1  1   status := $getjpiw ( , Request_pid , , Id_Item );
00308      1  1   if (status <> ss$_normal) and
00309      1  1      (status <> 2472) and
00310      1  1      (status <> ss$_suspended) then
00311      1  1    writeln(f1,'Bad return from $getjpi.  Status = ', status : 1);
00312      1  1   if (status = ss$_nomoreproc) then
00313      1  1    done := true;
00314      1  1   proc_count := proc_count + 1;
00315   C  1  1   {
00316   C  1  1        writeln(f1,'User = ', Id : 12, ' PID = ', PID : 8, ' cputim = '
00317   C  1  1      , cputim:1, ' State = ', Proc_State:1,' Term = ',terminal); 
00318   C  1  1   }
00319      1  1 
00320   C  1  1 { Put detached jobs in hell immediately... }
00321      1  1   if (jobtype = jpi$k_detached) and (not immune) then
00322      1  1    lower_priority(pid);
00323      1  1       
00324   C  1  1 { Inclued people at terminals.  Exclude immune users. }
00325      1  1   if ((terminal_length <> 0) or (owner <> 0)) and
00326      1  1      (not done) and 
00327      1  1      (not immune) then
00328      1  1    if (user_list[proc_count].pid <> pid) then
00329      1  2     begin
00330      1  2      user_list[proc_count].pid := pid;

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    7
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00331      1  2      user_list[proc_count].cputim := cputim;
00332   C  1  2      { writeln(f1,'Adding user ',Id,' Slot = ',proc_count:1); }
00333      1  2     end
00334      1  1    else
00335      1  1 
00336   C  1  1 { figure out if we should lower priority... }
00337      1  2     begin
00338      1  2      delta_cputim := cputim - user_list[proc_count].cputim;
00339      1  2      percent_cputim := (delta_cputim / interval_tics) * 100.0;
00340      1  2      user_list[proc_count].cputim := cputim;
00341   C  1  2 {     
00342   C  1  2      writeln(f1,'User ',Id,' delta = ',delta_cputim:6:2,' percent = ',
00343   C  1  2 		percent_cputim:6:2);
00344   C  1  2 }
00345   C  1  2 { increment the number of times we've found them in com state }
00346      1  2      if (Proc_state = sch$c_com) or (Proc_state = sch$c_como) then
00347      1  2        user_list[proc_count].com_count := user_list[proc_count].com_count + 1;
00348      1  2 
00349   C  1  2 { if they are over our maximum cpu percent allocation then lower them.  Or, }
00350   C  1  2 { if they have been in com state too long.  Either way we'll get them. }     
00351      1  2      if (percent_cputim > max_cputim) or
00352      1  2 	(((Proc_state = sch$c_com) or
00353      1  2 	(Proc_state = sch$c_como)) and
00354      1  2 	(user_list[proc_count].com_count >= max_com_state)) then
00355      1  2       lower_priority(pid)
00356      1  2      else
00357      1  2       if (prib < authpri) and 
00358      1  2          ((Proc_state <> sch$c_com) and
00359      1  2          (Proc_state <> sch$c_como)) then
00360      1  2         raise_priority(pid);
00361      1  1     end; { of else }
00362      0  0  end; { of process_a_user }
00363      0  0 
00364   C  0  0 {
00365   C  0  0 *******************************************************************
00366   C  0  0 ***		Mailbox Access Routines				***
00367   C  0  0 *******************************************************************
00368   C  0  0 }
00369      0  0 [asynchronous] function send_qio : integer; forward;
00370      0  0  
00371   C  0  0 { do_mbx_command and send_qio refer to each other }
00372      0  0  
00373   C  0  0 {-----------------------------------------------------------------------------}
00374      1  0 [asynchronous] procedure do_mbx_command;
00375      1  0 
00376   C  1  0  { This procedure is an AST that is called if a qio request is filled
00377   C  1  0    by a write to the com_killer_mbx mailbox.  It reads the string sent
00378   C  1  0    to the mailbox.  If the string is 'STOP' then the flag stop is set
00379   C  1  0    to true and the com_killer process will exit normally and close all
00380   C  1  0    log files.  If the message is not 'STOP' then another qio request is
00381   C  1  0    sent and the com_killer process continues.  This will allow for other
00382   C  1  0    interactive commands to com_killer to be added if needed.
00383   C  1  0  }
00384      1  0 var
00385      1  0   call_status: integer;

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    8
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00386      1  0   msg_length : $uword;
00387      1  0   message    : message_string;
00388      1  0 
00389      1  1    begin
00390      1  1       if index(mailbox_message,'STOP') <> 0 then
00391      1  2       begin
00392      1  2         stop:=true;
00393      1  2         call_status:=$wake ( prcnam:=proc_name);
00394      1  2         if call_status <> ss$_normal then
00395      1  3 	begin
00396      1  3 	  $getmsg(call_status, msg_length, message);
00397      1  3           writeln(f1,'Error in $WAKE, return message= ', message : msg_length );
00398      1  3 	end 
00399      1  2       end
00400      1  2       else begin
00401      1  2         writeln(f1,'error in do_mbx_command, no such command');
00402      1  2         call_status:=send_qio;
00403      1  2         if call_status <> ss$_normal then
00404      1  3         begin
00405      1  3           $getmsg( call_status, msg_length, message);
00406      1  3           writeln(f1,'Error in seucessive $QIO, return messsage = ', message:msg_length);
00407      1  3 	end 
00408      1  2       end
00409      1  2      
00410      0  0    end;
00411   C  0  0 {-----------------------------------------------------------------------------}
00412      1  0 function send_qio;
00413      1  0  
00414   C  1  0 {  This function does a qio to the com_killer_mbx that has been 
00415   C  1  0    opened with the open_mailbox function.  The AST that the qio
00416   C  1  0    will run when it is satisified is do_mbx_command.
00417   C  1  0 }
00418      1  0   var
00419      1  0 	call_status			: integer;
00420      1  0 	mbx_io_status  			: io_status_block;
00421      1  0         msg_length                      : $uword;
00422      1  0         message                         : message_string;
00423      1  1   begin
00424      1  1     call_status := $qio(	func	:= io$_readvblk,
00425      1  1 				chan	:= channel,
00426      1  1 				iosb	:= mbx_io_status,
00427      1  1                                 astadr  := do_mbx_command, 
00428      1  1 				P1	:= mailbox_message,
00429      1  1 				P2	:= max_string_length);
00430      1  1     mbx_msg_length := mbx_io_status.byte_count;
00431      1  1     if call_status <> ss$_normal then
00432      1  2     begin
00433      1  2       $getmsg( call_status, msg_length, message);
00434      1  2       writeln(f1,'error in SEND_QIO, return message= ',message : msg_length);
00435      1  2       if mbx_io_status.status <> ss$_normal then
00436      1  3       begin
00437      1  3         $getmsg( call_status, msg_length, message);
00438      1  3         writeln(f1,'error in SEND_QIO, return message= ',message : msg_length);
00439      1  2       end;
00440      1  1     end;

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page    9
01                              Source Listing                  10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

-LINE-IDC-PL-SL-

00441      1  1     send_qio:=call_status;
00442      0  0   end;
00443   C  0  0 {-----------------------------------------------------------------------------} 
00444      1  0 function open_mailbox( mailbox_name : string ) : integer; 
00445      1  0 
00446   C  1  0 { This function opens the mailbox and and sets it up with the proper
00447   C  1  0   parameters.
00448   C  1  0 }
00449      1  0   var
00450      1  0     call_status : integer;
00451      1  0      
00452      1  1   begin
00453      1  1     call_status := $crembx(	prmflg	:= permanent_flag,
00454      1  1 				chan	:= channel,
00455      1  1 				maxmsg	:= max_message,
00456      1  1 				bufquo	:= buffer_quota,
00457      1  1 				promsk	:= protection_mask,
00458      1  1 				acmode  := access_mode,
00459      1  1 				lognam 	:= mailbox_name);
00460      1  1     if call_status <> ss$_normal then
00461      1  2         begin
00462      1  2         $getmsg( call_status, msg_length, message);
00463      1  2         writeln(f1,'Error in $CREMBX, return message= ', message:msg_length );
00464      1  1 	end;
00465      1  1     open_mailbox := call_status;
00466      0  0   end;
00467      0  0  
00468   C  0  0 {-----------------------------------------------------------------------------}
00469      0  0 
00470      0  1 begin { main }
00471      0  1  Initialize;
00472      0  1  stop := false;
00473      0  1  status:= open_mailbox('com_killer_mbx');
00474      0  1  status:=send_qio;
00475      0  2  repeat
00476      0  2   done := false;
00477      0  2   proc_count := 0;
00478      0  2   Request_pid := -1;
00479      0  3   repeat
00480      0  3    process_a_user;
00481      0  2   until done;
00482      0  2   status := lib$wait(wait_time);
00483      0  1  until stop;          { Continue until stop is true.  }
00484      0  1 
00485      0  1  date(today);
00486      0  1  time(hour);
00487      0  1  writeln(f1,'stopped process com_killer at ',today,' ',hour,' the system is shutting down ');
00488      0  1  close(f1); 
00489      0  0 end.

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page   10
01                              Pascal Compilation Statistics   10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

PSECT SUMMARY

        Name                     Bytes                         Attributes

$CODE                                3750  NOVEC,NOWRT,  RD,  EXE,  SHR,  LCL,  REL,  CON,  PIC,ALIGN(2)
$LOCAL                               4892  NOVEC,  WRT,  RD,NOEXE,NOSHR,  LCL,  REL,  CON,  PIC,ALIGN(2)


ENVIRONMENT STATISTICS

                                                       -------- Symbols --------
        File                                           Total    Loaded   Percent

SYS$COMMON:[SYSLIB]STARLET.PEN;2                       20797       122         1


COMMAND QUALIFIERS

  PAS COM_KILLER/LIST

  /CHECK=(BOUNDS,NOCASE_SELECTORS,NOOVERFLOW,NOPOINTERS,NOSUBRANGE)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /SHOW=(DICTIONARY,INCLUDE,NOINLINE,HEADER,SOURCE,STATISTICS,TABLE_OF_CONTENTS)
  /OPTIMIZE
  /STANDARD=NONE
  /TERMINAL=(NOFILE_NAME,NOROUTINE_NAME,NOSTATISTICS)
  /USAGE=(NOUNUSED,UNINITIALIZED,NOUNCERTAIN)
  /NOANALYSIS_DATA
  /NOENVIRONMENT
  /LIST=DISK1:[SYSTEMS.KXBLD.PASCAL.COM_KILLER]COM_KILLER.LIS;9
  /OBJECT=DISK1:[SYSTEMS.KXBLD.PASCAL.COM_KILLER]COM_KILLER.OBJ;8
  /NOCROSS_REFERENCE /ERROR_LIMIT=30 /NOG_FLOATING /NOMACHINE_CODE /NOOLD_VERSION /WARNINGS


COMPILER INTERNAL TIMING

  Phase                 Faults       CPU Time      Elapsed Time
  Initialization          141        00:00.1          00:00.4
  Source Analysis         915        00:01.3          00:05.6
  Source Listing           18        00:00.2          00:00.5
  Tree Construction       141        00:00.1          00:00.2
  Flow Analysis            58        00:00.1          00:00.1
  Value Propagation        11        00:00.0          00:00.0
  Profit Analysis          65        00:00.1          00:00.1
  Context Analysis        336        00:00.6          00:00.7
  Name Packing              8        00:00.0          00:00.0
  Code Selection          113        00:00.2          00:00.2
  Final                    81        00:00.2          00:00.3
  TOTAL                  1891        00:03.0          00:08.1


COMPILATION STATISTICS

  CPU Time:       00:03.0         (9813 Lines/Minute)
  Elapsed Time:   00:08.1
  Page Faults:    1891
  Pages Used:     2130

COM_KILLER                                                      10-Apr-1989 09:48:10    VAX Pascal V3.7-254                Page   11
01                              Pascal Compilation Statistics   10-Apr-1989 09:47:52    COM_KILLER.PAS;16 (1)

  Compilation Complete
