i From:	HENRY::IN%"BRENT%uwovax.uwo.cdn%wiscvm.wisc.edu%sri-kl.ARPA%relay.cs.net@rca.com" 20-MAR-1987 13:52  To:	info-vax@SRI-KL.ARPA$ Subj:	SET_TIME limit command/utility  =    In reply to my query for a CPU time limit setting command, ? Brian Beesley was kind enough to send along his FORTRAN program : and 2 assembler routines.  We found the assembler routines: just fine, but the interface via FORTRAN to be clumsy.  So6 we hacked the interface in "C", and have the following= product available for the world.  (Apologies for the length). <    SET_TIME n   treats "n" as a delta time (in seconds), and7 sets the time limit for your process to the sum of your = current elapsed CPU time and "n" minutes.  SET_TIME is define 8 at UWO CCS as a foreign command.  The EXE processes "n".;    Treating "n" in minutes prevents ridiculously low limits < from being set.  As a delta time, inconsistencies associated> with setting the limit less than elapsed CPU time are avoided.A    We are planning on implementing batch queues with time limits. < So we made the command into a no-op for batch queues (SUBMIT+ lets you control the CPU limit adequately). =    The program requires CMKRNL privilege, and so is INSTALLed 8 at our site.  In limited testing it behaves as intended.9    The author included some caveats which follow (his own : words).  Following that is all our code along with the MAR7 routines to actually set the limit and read it back for : confirmation.  Feel free to suggest improvements or modify* this code for your own site usage.  Brent. ---------------- Brent,9       Here's the package for CPU override. I've tested it > with VMS V4.5 (after originally developing under VMS V3.7) and? it works OK. But, the macro routines must be recompiled and the 9 image relinked after an OS upgrade - well, major upgrades  anyway.   ;       The Fortran source is "skeletal", please feel free to < improve the user interface to your own convenience. The hard work gets done in macro anyway.   :       The program simply reads the new CPU limit as a long= integer in 10mS units (i.e. enter 6000 for 1 minute, etc) and < sets the CPU limit. Enter zero for infinite CPU. The program4 then reports the new CPU limit, again in 10mS units.  ;       Notes: a "strange" value may be set if you attempt to ; set a CPU limit smaller than the current elapsed CPU of the = process. Also the program may "appear" to work if the process = isn't sufficiently priveleged (needs CMKRNL) but in this case = the limit isn't changed - what I mean is that I didn't bother < to put in a check for CMKRNL but the priveleged routine does, nothing without the required priveleges set.  9       (The project dates from a time when we were looking : at letting all our users log on at priority 5 with a small; CPU limit, then allowing them to get more CPU in return for 7 a drop in base priority. It was dropped for "political" , reasons rather than technical difficulties).  6       Following are four short text files: one Fortran> source, two Macro source and a command file to compile & link.  )                               Best wishes +                               Brian Beesley    **** CPU.FOR ****          READ (5,200) ICPU    200 FORMAT(I6)       CALL CPUW(%REF(ICPU))        CALL CPUR(%REF(ICPU))        WRITE (6,100) ICPU!   100 FORMAT (1X,'CPUTIME: ',I12) 	       END   * **** CPUR.MAR ****      (duplicated later)* **** CPUW.MAR ****      (duplicated later)   **** CPU.COM **** 	 $ for cpu 
 $ mac cpur
 $ mac cpuw& $ lin cpu,cpur,cpuw,sys$system:sys.stb **** end of files ****   Brent,@ Please feel at liberty to make as much in the way of improvement@ as you wish to the "main program". Also distribute to the net by> all means ... bearing in mind the potential hazard to security? when intercepted by undesirable beings with too much privelege!   , I would think the main areas to aim for are:> (1) making input values "user friendly" (e.g. 30:00.00 instead
 of 180000)= (2) if you want to run at logon time, look at day of week and < hour of day (or load on machine?) then calculate a limit for the user@ (3) installing with privelege - don't forget to lose the symbols0 and traceback, else VMS V4 won't let you do this  > Incidentally, if you list the macros included in the assembler? modules that I supplied you with, it will become obvious how to < do other things with the entries in the process table - e.g.= change user name, page file quota, ... a real hacker's dream!   #                         Best wishes %                         Brian Beesley   = Warning on anything using CMKRNL ... all checking for illegal A addresses etc is removed in kernel mode. Therefore any code which > does anything daft in kernel mode will very probably cause the= machine to lie down and stick its feet in the air, maybe even 7 destroying a disk or two before finally coming to rest.   3 Dependencies in the code I supplied are as follows:   @ CPUR.MAR & CPUW.MAR *must* be recompiled if a new release of the= operating system contains a modified SYS$LIBRARY:MACROLIB.MLB   C The image *must* be relinked if SYS$SYSTEM:SYS.STB has been updated . (or following recompilation of the .MAR files)  F The Fortran bit probably never needs to be recompiled. Old, old .OBJ'sG created under VMS V1 still seem to link OK, though you might get better < code from the optimizer by recompiling with a later version.  F As regards future compatibility, there's nothing in the code which DECB could take out without a complete restructure of the OS. So far asD process tables are concerned, this did in fact happen between VMS V3I and V4 but the code still works. This bodes well for the future, although H I am of course not in a position to answer for the VMS development team!E (Of course, LOGINOUT.EXE does something similar to create the process C table entries in the first place, by reading values from SYSUAF and G stuffing them into the table slots. So long as it is possible to create C a process table entry in this way, it must be possible to change it  afterwards).  *                              Brian Beesley  C p.s. You've probably guessed that the call to CPUR is, in fact, for C reassurance only and is not neccessary to merely set the CPU limit.   H pps. If you're relatively new to VAX, a couple of hours spent in a quietG corner with the System Services and Run-Time Library manuals will prove I to be time well spent. Leave I/O till later, it's less neccessary (unless B you're into comms in a big way) and a lot harder to get a grip on. ---------------   E    Thanks also to Jeremy Skelton, London School of Economics, who had F a C program, but we were already well on the way by the time his offer arrived.    G =============   UWO CCS CODE NOW FOLLOWS        ============    (Brent)   5 -------------   TIME_LIMIT.C    ---------------------  #include <stdio.h> #include <ssdef.h> #include <jpidef.h>  #include <ctype.h> #include "accounting.h"  #include "$quidef.h" #include "$jbcdef.h" #include "descript.h"    static int jpi_cputim, junk;" static int name_len, search_flags; static char queue_name[32];   " static struct iolist jpilist[] = {*         {4,JPI$_CPUTIM,&jpi_cputim,&junk},         {0,0,0,0}};   " static struct iolist quilist[] = {.         {4,QUI$_SEARCH_FLAGS,&search_flags,0},2         {31,QUI$_QUEUE_NAME,queue_name,&name_len},         {0,0,0,0}};    main(argc,argv)   	 int argc; 
 char *argv[];      {      int cputime, delta_time;3     int limit_hr, limit_min, limit_sec, limit_hsec; +     int now_hr, now_min, now_sec, now_hsec;      int temp, test_len;      char char_test[20];         struct IO_STATUS_BLOCK iosb;  )     search_flags = QUI$M_SEARCH_THIS_JOB;   B     SYS$GETQUIW(0,                      /* No event flag        */B                 QUI$_DISPLAY_JOB,       /* Function code        */B                 0,                      /* Reserved for Dec     */B                 &quilist,               /* Item list:a structure*/B                 &iosb,                  /* IO status block      */B                 0,                      /* No AST routine       */B                 0);                     /* No AST paramater     */       if(name_len > 0)	         {cP         fprintf(stdout,"UWOCC-W-NBQ Set_time not implemented for Batch queues\n"         exit();E	         }t       if(argc < 2)	         { ;         fprintf(stderr,"UWOCC-F-Insuficient parameters\n");s         exit();g	         }l       sprintf(char_test,argv[1]);e!     test_len = strlen(char_test);b(     for(temp = 0;temp < test_len;temp++)	         {N$         if(isalpha(char_test[temp]))
             {nA             fprintf(stdout,"UWOCC-F-NNINPT Non numeric input\n");f             exit();S
             }a	         }   "     sscanf(argv[1],"%d",&cputime);       if (cputime == 0)e	         {u         delta_time = 0;e         cpuw(&delta_time);         cpur(&delta_time);    2         fprintf(stdout,"Time set to infinite \n");	         }      else	         {iB         SYS$GETJPI(0,0,0,       /* No event flag, same job      */B                    &jpilist,    /* Item list                    */B                    0,0,0);      /* No IO status block or AST    */  7         delta_time = jpi_cputim + (cputime * 60 * 100);          cpuw(&delta_time);         cpur(&delta_time);  &         now_hr  = jpi_cputim / 360000;1         temp    = jpi_cputim - (now_hr * 360000);d         now_min = temp /6000;.*         temp    = temp - (now_min * 6000);         now_sec = temp / 100;o*         now_hsec = temp - (now_sec * 100);  (         limit_hr  = delta_time / 360000;5         temp      = delta_time - (limit_hr * 360000);r          limit_min = temp / 6000;.         temp      = temp - (limit_min * 6000);         limit_sec = temp / 100;f.         limit_hsec = temp - (limit_sec * 100);    P         fprintf(stdout,"Cpu time %02d:%02d:%02d.%02d     Limit time %02d:%02d:%0;                         now_hr, now_min, now_sec, now_hsec,aD                         limit_hr, limit_min, limit_sec, limit_hsec);	         }l     }e6 -------------   CPUR.MAR        ----------------------     .TITLE    CPUR     .LIBRARY /SYS$LIBRARY:LIB/     $PCBDEFr     $PHDDEFr CPU:     .LONG     0 CPUR::   .WORD     $CMKRNL_S CPURF,     MOVL CPU,@4(AP)n     RET  CPURF:   .WORD     MOVL @#SCH$GL_CURPCB,R0n     MOVL PCB$L_PHD(R0),R0r     MOVL PHD$L_CPULIM(R0),CPU      RETn     .END6 -------------   CPUW.MAR        ----------------------     .TITLE    CPUW     .LIBRARY /SYS$LIBRARY:LIB/     $PCBDEF      $PHDDEF  CPU:     .LONG     0 CPUW::   .WORD     MOVL @4(AP),CPUf     $CMKRNL_S CPUWF,     RETN CPUWF:   .WORD     MOVL @#SCH$GL_CURPCB,R0      MOVL PCB$L_PHD(R0),R0n     MOVL CPU,PHD$L_CPULIM(R0)o     RETb     .END6 -------------   $JBCDEF.H       ----------------------" /* File: $jbcdef.h              */   #define JBC$_FACILITY  4  N /*                                                                          */P /* THE FOLLOWING CODES ARE RETURNED BY THE $SNDJBC, $GETQUI, $SNDJBC, AND $SNDSMN /* SYSTEM SERVICES, OR PLACED IN THE ACCOUNTING FILE.                       */N /*                                                                          */N /* THESE VALUES ARE PUBLIC AND MUST NOT CHANGE FROM RELEASE TO RELEASE.     */N /*                                                                          */P /* NOTE:        ERROR CODES WITH ASSOCIATED TEXT OF <> ARE RETIRED ERROR CODES AN /*      A SEVERITY LEVEL OF SEVERE.                                         */N /*                                                                          */  L #define JBC$_NORMAL  262145           /* <normal success completion>      */P #define JBC$_NOCMKRNL  272386         /* <operation requires CMKRNL privilege> *O #define JBC$_NOOPER  272530           /* <operation requires OPER privilege> */rP #define JBC$_NOSYSNAM  272402         /* <operation requires SYSNAM privilege> * #define JBC$_ILLDEVNAM  294916 #define JBC$_UNSDEVTYP  294924 #define JBC$_ILLFILNAM  294932 #define JBC$_INVQUENAM  294940 #define JBC$_NOPRIV  294946u #define JBC$_NOQUEHDR  294956s #define JBC$_NOQUESPACE  294962  #define JBC$_NOSUCHQUE  294970 #define JBC$_NOSUCHJOB  294978 #define JBC$_NOOPENJOB  294986 #define JBC$_REFERENCED  294994l #define JBC$_STARTED  295002 #define JBC$_INVITMCOD  295012 #define JBC$_INVFUNCOD  295020 #define JBC$_EMPTYJOB  295026y #define JBC$_JOBQUEDIS  295034 #define JBC$_JOBABORT  295044p #define JBC$_ACMINVOP  295052o #define JBC$_INVPARLEN  295060 #define JBC$_TRMMBXUSE  295068 #define JBC$_MAXSYMEXD  295076 #define JBC$_SCTTABFUL  295084 #define JBC$_CREPRCFAL  295092 #define JBC$_SYMNTBFUL  295100 #define JBC$_NODSTQUE  295106  #define JBC$_INVDSTQUE  295116 #define JBC$_JOBDELETE  295124 #define JBC$_NORESTART  295130 #define JBC$_JOBREQUEUE  295140  #define JBC$_QUERESET  295148m #define JBC$_SYSFAIL  295156 #define JBC$_EXECUTING  295162 #define JBC$_INVMSGBUF  295172 #define JBC$_MISREQPAR  295180 #define JBC$_INVPARVAL  295188 #define JBC$_INCQUETYP  295196 #define JBC$_INCDSTQUE  295204 #define JBC$_JOBQUEENA  295210 #define JBC$_NOTASSIGN  295218 #define JBC$_INCOMPLETE  295226S #define JBC$_INVCHANAM  295236 #define JBC$_INVFORNAM  295244 #define JBC$_NOSUCHCHAR  295250o #define JBC$_NOSUCHFORM  295258. #define JBC$_DUPFORM  295266 #define JBC$_INCFORMPAR  295276i #define JBC$_NOSUCHFILE  295282e #define JBC$_DELACCESS  295290 #define JBC$_QUENOTSTOP  295298e #define JBC$_NOMORECHAR  295306g #define JBC$_NOMOREFILE  295314r #define JBC$_NOMOREFORM  295322n #define JBC$_NOMOREJOB  295330 #define JBC$_NOMOREQUE  295338 #define JBC$_NOJOBCTX  295346s #define JBC$_NOQUECTX  295354   N /*                                                                          */P /* THE FOLLOWING CODES ARE SIGNALLED TO THE CONSOLE OR BROADCAST TO THE USER'S *N /* TERMINAL BY THE JOB CONTROLLER.                                          */N /*                                                                          */N /* THESE MESSAGES ARE NOT PUBLIC AND MAY CHANGE FROM RELEASE TO REALEASE.   */N /*                                                                          */O /* NOTE:  THE JOB CONTROLLER ABORTS EXECUTION AND RESTARTS ITSELF WHEN A SEVEREdN /*       ERROR IS SIGNALLED TO THE CONSOLE.                                 */N /*                                                                          */   #define JBC$_ACCDISERR  295939 #define JBC$_ALLOCMEM  295948u #define JBC$_COMREMJBC  295956 #define JBC$_INVBLOCK  295964e #define JBC$_INVMSG  295970c #define JBC$_NEWQUEUE  295979o #define JBC$_OPEJBCMBX  295988 #define JBC$_PRCREAT  295996 #define JBC$_QUEFORMAT  296000 #define JBC$_REAJBCMBX  296012 #define JBC$_REQUEST  296019 #define JBC$_SETIMR  296026n #define JBC$_SYMCREPRC  296034 #define JBC$_SYMDEL  296042  #define JBC$_WRIRSPMSG  296050 #define JBC$_WRISMBMBX  296058! #define JBC$_NFY_COMPLETE  296067-  #define JBC$_NFY_CURRENT  296075 #define JBC$_NFY_HOLD  296083<  #define JBC$_NFY_PENDING  296091 #define JBC$_NFY_TIMER  296099! #define JBC$_STRUCT_LEVEL  296107  #define JBC$_DIAGNOSTIC  296112i #define JBC$_DIAG_TEXT  296120 #define JBC$_DIAG_DATA  296128 #define JBC$_RESTRICT  296136c  #define JBC$_NFY_FAILURE  296147 #define JBC$_NFY_CPULIM  296155u #define JBC$_NFY_WSVAL  2961636 -------------   $QUIDEF.H       ---------------------- /*** MODULE $QUIDEF ***/  N /* Get Queue Information Service                                            */N /*                                                                          */O /* NOTE: New items must always be added at the end so users will not have to */wN /*       relink.                                                            */N /* Function codes                                                           */  M #define QUI$_CANCEL_OPERATION   1      /* Cancel a wildcard operation      */$N #define QUI$_DISPLAY_CHARACTERISTIC   2 /* Return characteristic attributes */M #define QUI$_DISPLAY_FILE   3          /* Return file attributes           */IM #define QUI$_DISPLAY_FORM   4          /* Return form attributes           */oM #define QUI$_DISPLAY_JOB   5           /* Return job attributes            */ M #define QUI$_DISPLAY_QUEUE   6         /* Return queue attributes          */mN #define QUI$_TRANSLATE_QUEUE   7       /* Validate and translate queue name */P #define QUI$_RESERVED_FUNC_1   8       /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_FUNC_2   9       /* Reserved for Digital use (name may cha  N /* Item codes                                                               */  M #define QUI$_ACCOUNT_NAME   1          /* Job: Submitter's account name    */aM #define QUI$_AFTER_TIME   2            /* Job: /AFTER time                 */nM #define QUI$_ASSIGNED_QUEUE_NAME   3   /* Queue: ASSIGN/QUEUE target       */aM #define QUI$_BASE_PRIORITY   4         /* Queue: /BASE_PRIORITY n          */_M #define QUI$_CHARACTERISTIC_NAME   5   /* Characteristic: Name             */ M #define QUI$_CHARACTERISTIC_NUMBER   6 /* Characteristic: Number           */ P #define QUI$_CHARACTERISTICS   7       /* Job, queue: /CHARACTERISTICS (c,...) *M #define QUI$_CHECKPOINT_DATA   8       /* Job: Checkpoint data             */ M #define QUI$_CLI   9                   /* Job: /CLI filename               */uP #define QUI$_COMPLETED_BLOCKS   10     /* Job: Completed blocks including checkpM #define QUI$_CONDITION_VECTOR   11     /* Job: Completion status           */0M #define QUI$_CPU_DEFAULT   12          /* Queue: /CPUDEFAULT t             */0M #define QUI$_CPU_LIMIT   13            /* Job, queue: /CPUMAXIMUM t        */ M #define QUI$_DEVICE_NAME   14          /* Queue: /ON device                */iM #define QUI$_ENTRY_NUMBER   15         /* Job: Entry number                */-M #define QUI$_FILE_COPIES   16          /* File: /COPIES n                  */mM #define QUI$_FILE_COPIES_CHKPT   17    /* File: File copies checkpoint     */dM #define QUI$_FILE_COPIES_DONE   18     /* File: File copies completed      */ M #define QUI$_FILE_FLAGS   19           /* File: Boolean information        */;M #define QUI$_FILE_SETUP_MODULES   20   /* File: /SETUP (module,...)        */ M #define QUI$_FILE_SPECIFICATION   21   /* File: Full file specification    */PM #define QUI$_FILE_STATUS   22          /* File: Status information         */ M #define QUI$_FIRST_PAGE   23           /* File: /PAGES (n,"")              */RM #define QUI$_FORM_DESCRIPTION   24     /* Form: /DESCRIPTION string        */RM #define QUI$_FORM_FLAGS   25           /* Form: Boolean information        */IM #define QUI$_FORM_LENGTH   26          /* Form: /LENGTH n                  */@M #define QUI$_FORM_MARGIN_BOTTOM   27   /* Form: /MARGIN BOTTOM n           */UM #define QUI$_FORM_MARGIN_LEFT   28     /* Form: /MARGIN LEFT n             */ M #define QUI$_FORM_MARGIN_RIGHT   29    /* Form: /MARGIN RIGHT n            */dM #define QUI$_FORM_MARGIN_TOP   30      /* Form: /MARGIN TOP n              */ M #define QUI$_FORM_NAME   31            /* Form, job, queue: Form name      */RM #define QUI$_FORM_NUMBER   32          /* Form: Number                     */AM #define QUI$_FORM_SETUP_MODULES   33   /* Form: /SETUP (module,...)        */ M #define QUI$_FORM_STOCK   34           /* Form: /STOCK stock-name          */CM #define QUI$_FORM_WIDTH   35           /* Form: /WIDTH n                   */ M #define QUI$_GENERIC_TARGET   36       /* Queue: /GENERIC (queue-name,...) */EM #define QUI$_INTERVENING_BLOCKS   37   /* Job: Intervening pending blocks  */LM #define QUI$_INTERVENING_JOBS   38     /* Job: Intervening pending jobs    */ M #define QUI$_JOB_COPIES   39           /* Job: /JOB_COUNT n                */2M #define QUI$_JOB_COPIES_CHKPT   40     /* Job: Job copies checkpoint       */2M #define QUI$_JOB_COPIES_DONE   41      /* Job: Job copies completed        */2M #define QUI$_JOB_FLAGS   42            /* Job: Boolean information         */AM #define QUI$_JOB_LIMIT   43            /* Queue: /JOB_LIMIT n              */EM #define QUI$_JOB_NAME   44             /* Job: Name                        */dP #define QUI$_JOB_RESET_MODULES   45    /* Queue: /SEPARATE RESET (module,...) */M #define QUI$_JOB_SIZE   46             /* Job: Total blocks in job         */fM #define QUI$_JOB_SIZE_MAXIMUM   47     /* Queue: /BLOCK_LIMIT n            */NM #define QUI$_JOB_SIZE_MINIMUM   48     /* Queue: /BLOCK_LIMIT (n,"")       */fM #define QUI$_JOB_STATUS   49           /* Job: Status information          */DM #define QUI$_LAST_PAGE   50            /* File: /PAGES n                   */fP #define QUI$_LIBRARY_SPECIFICATION   51 /* Queue: /LIBRARY file-specification */M #define QUI$_LOG_QUEUE   52            /* Job: /PRINTER queue-name         */nN #define QUI$_LOG_SPECIFICATION   53    /* Job: /LOG_FILE file-specification */M #define QUI$_NOTE   54                 /* Job: /NOTE string                */nM #define QUI$_OPERATOR_REQUEST   55     /* Job: /OPERATOR string            */LM #define QUI$_OWNER_UIC   56            /* Queue: /OWNER uic                */nM #define QUI$_PAGE_SETUP_MODULES   57   /* Form: /PAGE_SETUP (module,...)   */PM #define QUI$_PARAMETER_1   58          /* Job: /PARAMETER string           */n #define QUI$_PARAMETER_2   59n #define QUI$_PARAMETER_3   60f #define QUI$_PARAMETER_4   61f #define QUI$_PARAMETER_5   62f #define QUI$_PARAMETER_6   63d #define QUI$_PARAMETER_7   64  #define QUI$_PARAMETER_8   65dM #define QUI$_PRIORITY   66             /* Job: /PRIORITY n                 */DM #define QUI$_PROCESSOR   67            /* Queue: /PROCESSOR filename       */5M #define QUI$_PROTECTION   68           /* Queue: /PROTECTION mask          */nM #define QUI$_QUEUE_FLAGS   69          /* Queue: Boolean information       */ M #define QUI$_QUEUE_NAME   70           /* Job, queue: Queue name           */ M #define QUI$_QUEUE_STATUS   71         /* Queue: Status information        */DM #define QUI$_REFUSAL_REASON   72       /* Job: Reason symbiont refused job */.M #define QUI$_REQUEUE_PRIORITY   73     /* Job: Priority after requeue      */ M #define QUI$_REQUEUE_QUEUE_NAME   74   /* Job: Queue after requeue         */AM #define QUI$_SCSNODE_NAME   75         /* Queue: /ON node::                */ M #define QUI$_SEARCH_FLAGS   76         /* Flags to control search          */TN #define QUI$_SEARCH_NAME   77          /* Object name to search for         */M #define QUI$_SEARCH_NUMBER   78        /* Object number to search for      */ M #define QUI$_SUBMISSION_TIME   79      /* Job: Submission time             */9M #define QUI$_UIC   80                  /* Job: Submitter's UIC             */IM #define QUI$_USERNAME   81             /* Job: Submitter's username        */ M #define QUI$_WSDEFAULT   82            /* Job, queue: /WSDEFAULT n         */OM #define QUI$_WSEXTENT   83             /* Job, queue: /WSEXTENT n          */fM #define QUI$_WSQUOTA   84              /* Job, queue: /WSQUOTA n           */2P #define QUI$_RESERVED_BOOLEAN_1   85   /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_BOOLEAN_2   86   /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_INPUT_1   87     /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_INPUT_2   88     /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_1   89    /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_2   90    /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_3   91    /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_4   92    /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_5   93    /* Reserved for Digital use (name may chaP #define QUI$_RESERVED_OUTPUT_6   94    /* Reserved for Digital use (name may cha  N /*                                                                          */N /* Structure of FILE_FLAGS item.                                            */N /*                                                                          */   #define QUI$M_FILE_BURST   1  #define QUI$M_FILE_BURST_EXP   2 #define QUI$M_FILE_DELETE   4n# #define QUI$M_FILE_DOUBLE_SPACE   8e #define QUI$M_FILE_FLAG   16  #define QUI$M_FILE_FLAG_EXP   32 #define QUI$M_FILE_TRAILER   64t$ #define QUI$M_FILE_TRAILER_EXP   128$ #define QUI$M_FILE_PAGE_HEADER   256! #define QUI$M_FILE_PAGINATE   512D! #define QUI$M_FILE_PASSALL   1024q& #define QUI$M_FILE_PAGINATE_EXP   2048  N /*                                                                          */N /* Structure of FILE_STATUS item.                                           */N /*                                                                          */  # #define QUI$M_FILE_CHECKPOINTED   1   #define QUI$M_FILE_EXECUTING   2  N /*                                                                          */N /* Structure of FORM_FLAGS item.                                            */N /*                                                                          */  ! #define QUI$M_FORM_SHEET_FEED   1  #define QUI$M_FORM_TRUNCATE   2  #define QUI$M_FORM_WRAP   4R    N /*                                                                          */N /* Structure of JOB_FLAGS item.                                             */N /*                                                                          */   #define QUI$M_JOB_CPU_LIMIT   1a  #define QUI$M_JOB_FILE_BURST   2$ #define QUI$M_JOB_FILE_BURST_ONE   4$ #define QUI$M_JOB_FILE_BURST_EXP   8  #define QUI$M_JOB_FILE_FLAG   16$ #define QUI$M_JOB_FILE_FLAG_ONE   32$ #define QUI$M_JOB_FILE_FLAG_EXP   64$ #define QUI$M_JOB_FILE_TRAILER   128( #define QUI$M_JOB_FILE_TRAILER_ONE   256( #define QUI$M_JOB_FILE_TRAILER_EXP   512# #define QUI$M_JOB_LOG_DELETE   1024 ! #define QUI$M_JOB_LOG_NULL   2048 " #define QUI$M_JOB_LOG_SPOOL   4096" #define QUI$M_JOB_LOWERCASE   8192  #define QUI$M_JOB_NOTIFY   16384! #define QUI$M_JOB_RESTART   32768m# #define QUI$M_JOB_WSDEFAULT   65536F# #define QUI$M_JOB_WSEXTENT   131072P" #define QUI$M_JOB_WSQUOTA   262144( #define QUI$M_JOB_FILE_PAGINATE   524288- #define QUI$M_JOB_FILE_PAGINATE_EXP   1048576_    N /*                                                                          */N /* Structure of JOB_STATUS item.                                            */N /*                                                                          */   #define QUI$M_JOB_ABORTING   1 #define QUI$M_JOB_EXECUTING   2U #define QUI$M_JOB_HOLDING   4 " #define QUI$M_JOB_INACCESSIBLE   8 #define QUI$M_JOB_REFUSED   16 #define QUI$M_JOB_REQUEUE   32! #define QUI$M_JOB_RESTARTING   64_  #define QUI$M_JOB_RETAINED   128  #define QUI$M_JOB_STARTING   256 #define QUI$M_JOB_TIMED   512     N /*                                                                          */N /* Structure of QUEUE_FLAGS item.                                           */N /*                                                                          */   #define QUI$M_QUEUE_BATCH   1*# #define QUI$M_QUEUE_CPU_DEFAULT   22! #define QUI$M_QUEUE_CPU_LIMIT   4 " #define QUI$M_QUEUE_FILE_BURST   8' #define QUI$M_QUEUE_FILE_BURST_ONE   16 " #define QUI$M_QUEUE_FILE_FLAG   32& #define QUI$M_QUEUE_FILE_FLAG_ONE   64& #define QUI$M_QUEUE_FILE_TRAILER   128* #define QUI$M_QUEUE_FILE_TRAILER_ONE   256! #define QUI$M_QUEUE_GENERIC   512_, #define QUI$M_QUEUE_GENERIC_SELECTION   1024$ #define QUI$M_QUEUE_JOB_BURST   2048# #define QUI$M_QUEUE_JOB_FLAG   4096 ) #define QUI$M_QUEUE_JOB_SIZE_SCHED   8192 ' #define QUI$M_QUEUE_JOB_TRAILER   16384 & #define QUI$M_QUEUE_RETAIN_ALL   32768( #define QUI$M_QUEUE_RETAIN_ERROR   65536! #define QUI$M_QUEUE_SWAP   131072K% #define QUI$M_QUEUE_TERMINAL   262144o& #define QUI$M_QUEUE_WSDEFAULT   524288& #define QUI$M_QUEUE_WSEXTENT   1048576% #define QUI$M_QUEUE_WSQUOTA   2097152 + #define QUI$M_QUEUE_FILE_PAGINATE   4194304*- #define QUI$M_QUEUE_RECORD_BLOCKING   8388608o    N /*                                                                          */N /* Structure of QUEUE_STATUS item.                                          */N /*                                                                          */    #define QUI$M_QUEUE_ALIGNING   1 #define QUI$M_QUEUE_IDLE   2! #define QUI$M_QUEUE_LOWERCASE   4 ( #define QUI$M_QUEUE_OPERATOR_REQUEST   8 #define QUI$M_QUEUE_PAUSED   16(  #define QUI$M_QUEUE_PAUSING   32 #define QUI$M_QUEUE_REMOTE   64l# #define QUI$M_QUEUE_RESETTING   128U" #define QUI$M_QUEUE_RESUMING   256  #define QUI$M_QUEUE_SERVER   512" #define QUI$M_QUEUE_STALLED   1024# #define QUI$M_QUEUE_STARTING   2048 " #define QUI$M_QUEUE_STOPPED   4096# #define QUI$M_QUEUE_STOPPING   8192 ' #define QUI$M_QUEUE_UNAVAILABLE   16384     N /*                                                                          */N /* Definition of SEARCH_FLAGS                                               */N /*                                                                          */  ! #define QUI$M_SEARCH_ALL_JOBS   1c! #define QUI$M_SEARCH_WILDCARD   2  #define QUI$M_SEARCH_BATCH   4! #define QUI$M_SEARCH_SYMBIONT   8O" #define QUI$M_SEARCH_THIS_JOB   16  2 -------------   ACCOUNTING.H    ------------------2 -------------   (from another "C" project)--------   #include <stdio.h> #include <ssdef.h> #include <iodef.h> #include <stsdef.h>  #include <descrip.h>  J #define EFN_MBX_INPUT   1       /* event flag for mailbox input         */  @ #define SUCCESS(cond_value)         (cond_value & STS$M_SUCCESS)A #define FAILURE(cond_value)         !(cond_value & STS$M_SUCCESS)6   struct IO_STATUS_BLOCK	         {d#         unsigned short      status; +         short               transfer_count;I,         unsigned long       device_specific;
         };   #define DSC$K_DTYPE_BU  2i #define DSC$K_CLASS_S   1U* #define DVI$_TT_PHYDEVNAM       0x00000112  , ----------      DESCRIPT.H      ------------  " /*      FIXED LENGTH DESCRIPTOR */   struct  fix_len_descript	         {N         short   b_len;         char    b_dtype;         char    b_clas;E         char    *b_adr;          } ;   " /*      IOLIST   DESCRIPTOR     */   struct  iolist	         {o         short   item;s         short   buflen;R         long    *bufadr;         long    *retlen;         } ;   6 -------------   TIME_LIMIT.COM  ---------------------- $ !  time_limit.com 9 $ !  Build time_limit.exe for UWO CCS time limit command. # $ !  Brent Sterner.   March 3 1987.C* $ !  Modified by Chris Lee later in March. $ cc time_limit/lisf $ macro/list cpurE $ macro/list cpuwb> $ link/notrace/nodebug time_limit,cpur,cpuw,sys$system:sys.stb $ purge *.obj, *.exe $ ! **** end of files **** $exitn ------------------------- A         As a last step, define time_limit as a foreign command to =         run the EXE file, and INSTALL with CMKRNL privileges.n -------------------------  --H Brent Sterner                                    ***********************H Lord Protector,  d i g i t a l  Systems          *                     *H Computing & Communications Services              *   ...this space     *H Natural Sciences Building                        *   for rent...       *H The University of Western Ontario                *   Apply within.     *H London, Ontario, Canada  N6A 5B7                 *                     *H Telephone (519)661-2151 x6036                    ***********************. Network     <BRENT@uwovax.UWO.CDN>  ! VAX 8600.             <A105@UWOCC1.BITNET>    ! IBM 4341