COMPILATION LISTING OF SEGMENT charge_user_ Compiled by: Multics PL/I Compiler, Release 30, of February 16, 1988 Compiled at: Honeywell Bull, Phoenix AZ, SysM Compiled on: 08/29/88 0922.4 mst Mon Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1988 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 charge_user_: proc (name, proj, dp, code); 13 14 /* CHARGE_USER_ - program to increment a user's usage meters in his PDT entry */ 15 16 /* modified on 10/22/74 by J. Whitmore to be compatible with the access isolation 17* mechanism. The program assumes that all PDTs are in the same directory and 18* hence, all have the same access class. This allows the process to test for 19* needing system privileges only once (unless the debug entry is called.) 20* Modified May 1980 by R. McDonald to include printer page charging. 21**/ 22 23 24 /****^ HISTORY COMMENTS: 25* 1) change(87-08-11,GDixon), approve(88-08-15,MCR7969), 26* audit(88-08-03,Lippard), install(88-08-29,MR12.2-1093): 27* Correct setting of code parm (phx14431). 28* END HISTORY COMMENTS */ 29 30 31 dcl name char (*), /* person name */ 32 proj char (*), /* project ID */ 33 dp ptr, /* ptr to dummy pdt entry */ 34 code fixed bin (35); /* error code returned if not found */ 35 36 dcl pdtp ptr, /* ptr to current pdt */ 37 pdtep ptr, /* ptr to current pdt entry */ 38 pdt_name char (32) aligned, /* name of pdt */ 39 (i, j) fixed bin, /* counters */ 40 setsw bit (1) aligned init ("0"b), /* tells which entry */ 41 ec fixed bin (35), /* errcode */ 42 (init, need_priv) bit (1) aligned int static init ("0"b), /* priv control bits */ 43 access_class bit (72) aligned; /* access class of data seg..(PDT) */ 44 45 dcl error_table_$lock_wait_time_exceeded fixed bin (35) ext static, 46 error_table_$moderr fixed bin (35) ext static; 47 48 dcl linkage_error condition; 49 50 dcl sysdir char (168) aligned int static init (">system_control_1>pdt"); 51 52 dcl ioa_$rsnnl entry options (variable), 53 hcs_$initiate entry (char (*) aligned, char (*) aligned, char (*) aligned, 54 fixed bin (1), fixed bin (2), ptr, fixed bin (35)), 55 hcs_$get_access_class entry (char (*) aligned, char (*) aligned, bit (72) aligned, fixed bin (35)), 56 system_privilege_$initiate entry (char (*) aligned, char (*) aligned, char (*) aligned, 57 fixed bin (1), fixed bin (2), ptr, fixed bin (35)), 58 get_authorization_ entry () returns (bit (72) aligned), 59 read_write_allowed_ entry (bit (72) aligned, bit (72) aligned) returns (bit (1) aligned), 60 clock_ entry () returns (fixed bin (71)), 61 set_lock_$lock entry (bit (36) aligned, fixed bin, fixed bin (35)), 62 set_lock_$unlock entry (bit (36) aligned, fixed bin (35)), 63 hcs_$terminate_noname entry (ptr, fixed bin (35)); 64 65 dcl (null, addr) builtin; 66 1 1 /* BEGIN INCLUDE FILE ... user_attributes.incl.pl1 TAC 10/79 */ 1 2 1 3 1 4 /****^ HISTORY COMMENTS: 1 5* 1) change(86-12-11,Brunelle), approve(87-07-13,MCR7741), 1 6* audit(87-04-19,GDixon), install(87-08-04,MR12.1-1056): 1 7* Add incl for abs_attributes.incl.pl1 to automatically include absentee 1 8* attribute switches. 1 9* 2) change(87-04-19,GDixon), approve(87-07-13,MCR7741), 1 10* audit(87-07-16,Brunelle), install(87-08-04,MR12.1-1056): 1 11* A) Add USER_ATTRIBUTE_NAMES arrays. attribute_names.incl.pl1 can thereby 1 12* be deleted. 1 13* B) Add constants identifying attributes that can be changed by user at 1 14* login, etc. 1 15* END HISTORY COMMENTS */ 1 16 1 17 1 18 /* Modified 82-01-03 E. N. Kittlitz. to declare a complete level-1 structure */ 1 19 1 20 /* format: style4 */ 1 21 dcl 1 user_attributes aligned based, /* the user user_attributes */ 1 22 (2 administrator bit (1), /* 1 system administrator privileges */ 1 23 2 primary_line bit (1), /* 2 user has primary-line privileges */ 1 24 2 nobump bit (1), /* 2 user cannot be bumped */ 1 25 2 guaranteed_login bit (1), /* 4 user has guaranteed login privileges */ 1 26 2 anonymous bit (1), /* 5 used only in SAT. project may have anon.users */ 1 27 2 nopreempt bit (1), /* 6 used only in PDT. user not preemptable by others 1 28* . of same project (distinct from "nobump") */ 1 29 2 nolist bit (1), /* 7 don't list user on "who" */ 1 30 2 dialok bit (1), /* 8 user may have multiple consoles */ 1 31 2 multip bit (1), /* 9 user may have several processes */ 1 32 2 bumping bit (1), /* 10 in SAT. Can users in project bump each other? */ 1 33 2 brief bit (1), /* 11 no login or logout message */ 1 34 2 vinitproc bit (1), /* 12 user may change initial procedure */ 1 35 2 vhomedir bit (1), /* 13 user may change homedir */ 1 36 2 nostartup bit (1), /* 14 user does not want start_up.ec */ 1 37 2 sb_ok bit (1), /* 15 user may be standby */ 1 38 2 pm_ok bit (1), /* 16 user may be primary */ 1 39 2 eo_ok bit (1), /* 17 user may be edit_only */ 1 40 2 daemon bit (1), /* 18 user may login as daemon */ 1 41 2 vdim bit (1), /* 19 * OBSOLETE * user may change outer mdle */ 1 42 2 no_warning bit (1), /* 20 no warning message */ 1 43 2 igroup bit (1), /* 21 in SAT: this project may give its users individual groups 1 44* . in PDT: this user has an individual load control group */ 1 45 2 save_pdir bit (1), /* 22 save pdir after fatal process error */ 1 46 2 disconnect_ok bit (1), /* 23 ok to save user's disconnected processes */ 1 47 2 save_on_disconnect bit (1), /* 24 save them unless -nosave login arg is given */ 1 48 2 pad bit (12)) unaligned; 1 49 1 50 dcl USER_ATTRIBUTE_NAMES (0:24) char (20) int static options (constant) init 1 51 ("none", /* 0 */ 1 52 "administrator", /* 1 */ 1 53 "primary_line", /* 2 */ 1 54 "nobump", /* 3 */ 1 55 "guaranteed_login", /* 4 */ 1 56 "anonymous", /* 5 */ 1 57 "nopreempt", /* 6 */ 1 58 "nolist", /* 7 */ 1 59 "dialok", /* 8 */ 1 60 "multip", /* 9 */ 1 61 "bumping", /* 10 */ 1 62 "brief", /* 11 */ 1 63 "vinitproc", /* 12 */ 1 64 "vhomedir", /* 13 */ 1 65 "nostartup", /* 14 */ 1 66 "no_secondary", /* 15 */ 1 67 "no_prime", /* 16 */ 1 68 "no_eo", /* 17 */ 1 69 "daemon", /* 18 */ 1 70 "", /* 19 vdim OBSOLETE */ 1 71 "no_warning", /* 20 */ 1 72 "igroup", /* 21 */ 1 73 "save_pdir", /* 22 */ 1 74 "disconnect_ok", /* 23 */ 1 75 "save_on_disconnect"); /* 24 */ 1 76 1 77 dcl ALT_USER_ATTRIBUTE_NAMES (0:24) char (20) int static options (constant) init 1 78 ("null", /* 0 */ 1 79 "admin", /* 1 */ 1 80 "", "", /* 2 - 3 */ 1 81 "guar", /* 4 */ 1 82 "anon", /* 5 */ 1 83 "", "", /* 6 - 7 */ 1 84 "dial", /* 8 */ 1 85 "multi_login", /* 9 */ 1 86 "preempting", /* 10 */ 1 87 "", /* 11 */ 1 88 "v_process_overseer", /* 12 */ 1 89 "v_home_dir", /* 13 */ 1 90 "no_start_up", /* 14 */ 1 91 "no_sec", /* 15 */ 1 92 "no_primary", /* 16 */ 1 93 "no_edit_only", /* 17 */ 1 94 "op_login", /* 18 */ 1 95 "", /* 19 */ 1 96 "nowarn", /* 20 */ 1 97 "", "", "", /* 21 - 23 */ 1 98 "save"); /* 24 */ 1 99 1 100 dcl USER_ATTRIBUTES_always_allowed bit (36) aligned int static 1 101 options(constant) init("000000000010000000010000000000000000"b); 1 102 /* SAT/PDT attributes not needed for user to give (brief, no_warning) */ 1 103 1 104 dcl USER_ATTRIBUTES_default_in_pdt bit (36) aligned int static 1 105 options(constant) init("000000000010000000010000000000000000"b); 1 106 /* PDT value for (brief, no_warning) is default */ 1 107 1 108 dcl USER_ATTRIBUTES_settable_by_user bit (36) aligned int static 1 109 options(constant) init("000100000110010000010000000000000000"b); 1 110 /* user MIGHT set (bump, ns, brief, guar, no_warning) */ 1 111 2 1 /* BEGIN INCLUDE FILE ... user_abs_attributes.incl.pl1 */ 2 2 2 3 /* * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 4 /* */ 2 5 /* This include file describes the attributes of an absentee job. It is */ 2 6 /* used by user_table_entry.incl.pl1, abs_message_format.incl.pl1 */ 2 7 /* and PIT.incl.pl1. */ 2 8 /* */ 2 9 /* * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 10 2 11 /****^ HISTORY COMMENTS: 2 12* 1) change(86-12-08,GDixon), approve(87-07-13,MCR7741), 2 13* audit(87-07-16,Brunelle), install(87-08-04,MR12.1-1056): 2 14* Separated abs_attributes from the request structure 2 15* (abs_message_format.incl.pl1) so that the identical structure could be 2 16* used in the ute structure (user_table_entry.incl.pl1). 2 17* 2) change(87-04-19,GDixon), approve(87-07-13,MCR7741), 2 18* audit(87-07-16,Brunelle), install(87-08-04,MR12.1-1056): 2 19* Added ABS_ATTRIBUTE_NAMES array. 2 20* 3) change(87-11-11,Parisek), approve(88-02-11,MCR7849), 2 21* audit(88-03-22,Lippard), install(88-07-13,MR12.2-1047): 2 22* Added the no_start_up flag. SCP6367 2 23* END HISTORY COMMENTS */ 2 24 2 25 dcl 1 user_abs_attributes aligned based, 2 26 2 restartable bit (1) unaligned, /* 1 if request may be started over from the beginning */ 2 27 2 user_deferred_until_time bit (1) unaligned, /* 1 if request was specified as deferred */ 2 28 2 proxy bit (1) unaligned, /* 1 if request submitted for someone else */ 2 29 2 set_bit_cnt bit (1) unaligned, /* 1 if should set bit count after every write call */ 2 30 2 time_in_gmt bit (1) unaligned, /* 1 if deferred_time is in GMT */ 2 31 2 user_deferred_indefinitely bit (1) unaligned, /* 1 if operator is to say when to run it */ 2 32 2 secondary_ok bit (1) unaligned, /* 1 if ok to log in as secondary foreground user */ 2 33 2 truncate_absout bit (1) unaligned, /* 1 if .absout is to be truncated */ 2 34 2 restarted bit (1) unaligned, /* 1 if job is restarted */ 2 35 2 no_start_up bit (1) unaligned, /* 1 if requested -ns */ 2 36 2 attributes_pad bit (26) unaligned; 2 37 2 38 dcl ABS_ATTRIBUTE_NAMES (10) char (28) varying int static options(constant) init( 2 39 "restartable", 2 40 "user_deferred_until_time", 2 41 "proxy", 2 42 "set_bit_cnt", 2 43 "time_in_gmt", 2 44 "user_deferred_indefinitely", 2 45 "secondary_ok", 2 46 "truncate_absout", 2 47 "restarted", 2 48 "no_start_up"); 2 49 2 50 /* END INCLUDE FILE ... user_abs_attributes.incl.pl1 */ 2 51 1 112 1 113 1 114 /* END INCLUDE FILE ... user_attributes.incl.pl1 */ 67 3 1 /* BEGIN INCLUDE FILE ... pdt.incl.pl1 */ 3 2 /* Requires user_attributes.incl.pl1 */ 3 3 3 4 /* Modified 740723 by PG to add AIM info */ 3 5 /* Modified 750604 by T. Casey to add priority scheduler parameters */ 3 6 /* Modified May 1976 by T. Casey to add cutoff warning thresholds and change version to 3 */ 3 7 /* Modified May 1977 by John Gintell to add reqfile, projfile, and SAT to header */ 3 8 /* Modified May 1978 by T. Casey to add pdir_quota to user entry */ 3 9 /* Modified June 1978 by T. Casey to add rel ptr to pdt hash table */ 3 10 /* Modified November 1978 by T. Casey to add max_(fore back)ground, n_(fore back)ground and abs_foreground_cpu_limit */ 3 11 /* Modified October 1979 by T. Casey to add counters for interactive and disconnected processes. */ 3 12 /* Modified Feb 1980 by M. B. Armstrong to implement multiple rate structures (UNCA). */ 3 13 /* Modified May 1980 by R. McDonald to use iod cpu time field for page charging (UNCA) */ 3 14 /* Modified December 1981 by E. N. Kittlitz for user_warn fields */ 3 15 /* Modified January 1982 by E. N. Kittlitz for user_attributes.incl.pl1 changes */ 3 16 /* Modified September 1982 by E. N. Kittlitz for default ring. */ 3 17 /* Modified 1984-07-05 BIM for min authorization, version to 4 */ 3 18 3 19 dcl (PDT_version init (4), /* version of this declaration */ 3 20 PDT_header_lth init (256), /* length in words of PDT head */ 3 21 PDT_entry_lth init (256), /* length in words of PDT entry */ 3 22 3 23 PDT_project_name_length init (9), /* proper length of pdt.project_name */ 3 24 PDT_person_id_length init (22) /* proper length of user.person_id */ 3 25 ) fixed bin internal static options (constant); 3 26 3 27 dcl 1 pdt based (pdtp) aligned, 3 28 4 1 /* BEGIN INCLUDE FILE author.incl.pl1 */ 4 2 4 3 /* the "author" items must always be the first ones in the table. The 4 4* module which moves the converted table to the System Control process 4 5* fills in these data items and assumes them to be at the head of the segment 4 6* regardless of the specific table's actual declaration. The variables 4 7* "lock" and "last_install_time" used to be "process_id" and "ev_channel" 4 8* respectively. For tables installed in multiple processes, these 4 9* are to be used to lock out multiple installations. */ 4 10 4 11 /* Lock should be used as a modification lock. Since, in general, 4 12* entries may not be moved in system tables, even by installations, 4 13* it is sufficient for only installers and programs that change threads 4 14* to set or respect the lock. Simply updating data in an entry 4 15* requires no such protection. 4 16* 4 17* Last_install_time is used by readers of system tables to detect 4 18* installations or other serious modifications. By checking it before 4 19* and after copying a block of data, they can be protected against 4 20* modifications. 4 21* 4 22* Modules that set the lock should save proc_group_id, and then 4 23* put their group id there for the time they hold the lock. 4 24* if they do not actually install the, they should restore the group id. 4 25**/ 4 26 4 27 2 author aligned, /* validation data about table's author */ 4 28 3 proc_group_id char (32), /* process-group-id (personid.projectid.tag) */ 4 29 3 lock bit (36), /* installation lock */ 4 30 3 update_attributes bit (1) unal, /* update/add/delete attributes */ 4 31 3 update_authorization bit (1) unal, /* update only authorizations */ 4 32 3 deferral_notified bit (1) unal, /* installer notified of deferral of installation */ 4 33 3 pad bit (33) unaligned, 4 34 3 last_install_time fixed bin (71), 4 35 3 table char (4), /* name of table, e.g., SAT MGT TTT RTDT PDT etc. */ 4 36 3 w_dir char (64), /* author's working directory */ 4 37 4 38 /* END INCLUDE FILE author.incl.pl1 */ 3 29 3 30 2 max_size fixed bin, /* max number of entries table can grow */ 3 31 2 current_size fixed bin, /* current size of table (in entries) */ 3 32 2 version fixed bin, /* table version */ 3 33 2 freep fixed bin, /* relptr to begin of free chain */ 3 34 2 n_users fixed bin, /* number of entries actually used */ 3 35 2 project_name char (28), /* name of project */ 3 36 2 project_dir char (64), /* treename of project's directory */ 3 37 2 projfile_version fixed bin, 3 38 2 projentry bit (66*36), 3 39 2 pad3 (5) bit (36) aligned, 3 40 2 reqfile_version fixed bin, 3 41 2 reqentry bit (40*36), 3 42 2 pad4 (9) fixed bin, 3 43 2 sat_version fixed bin, 3 44 2 satentry bit (52*36), /* everything in sat.project from project.at on */ 3 45 2 pad5 (4) bit (36) aligned, 3 46 2 date_reqfile_copied fixed bin (71), 3 47 2 rs_number fixed bin (9) unsigned unaligned, /* rate structure number, easier than looking in satentry */ 3 48 2 pad2l bit (27) unaligned, 3 49 2 pad2 (16) fixed bin, /* make header 256 words long */ 3 50 2 ht_relp fixed bin (18) aligned, /* if nonzero, pdt has hash table at that loc */ 3 51 2 user (1019) aligned, /* the project definition table entries */ 3 52 3 pad (256) bit (36) aligned; /* each entry is 256 words long */ 3 53 3 54 /* The hash table, if there is one, is right after the last user, and is described in hashst.incl.pl1 */ 3 55 3 56 3 57 3 58 dcl 1 user based (pdtep) aligned, /* declaration of a single PDT entry */ 3 59 2 state fixed bin, /* 1 = normal, 2 = deleted 0 = free */ 3 60 2 lock bit (36), /* update lock */ 3 61 2 person_id char (24) aligned, /* login name of user */ 3 62 2 now_in fixed bin, /* count of users logged in on this entry */ 3 63 2 password char (8) aligned, /* password for anonymous user */ 3 64 2 at like user_attributes aligned, /* include user_attributes.incl.pl1 */ 3 65 2 initial_procedure char (64) aligned, /* initproc and subsystem name packed into one string */ 3 66 2 home_dir char (64) aligned, /* user's default working directory */ 3 67 2 bump_grace fixed bin, /* number of minutes he is protected */ 3 68 2 high_ring fixed bin, /* highest ring user may use */ 3 69 2 default_ring fixed bin (17) unal, /* ring user will start in */ 3 70 2 low_ring fixed bin (17) unal, /* lowest ring user may use */ 3 71 2 outer_module char (32), /* outer module used if user is interactive */ 3 72 2 lot_size fixed bin, /* size of linkage offset table */ 3 73 2 kst_size fixed bin, /* size of known segment table */ 3 74 2 cls_size fixed bin, /* size of combined linkage */ 3 75 2 uflags, /* various flags */ 3 76 3 dont_call_init_admin bit (1) unal, /* call overseer direct */ 3 77 3 ip_given bit (1) unal, /* ip_len gives length of initproc packed in initial_procedure */ 3 78 3 ss_given bit (1) unal, /* subsystem name is packed in initial_procedure */ 3 79 3 flagpad bit (33) unal, 3 80 2 ip_len fixed bin (17) unal, /* length of initproc name packed in initial_procedure */ 3 81 2 ss_len fixed bin (17) unal, /* length of subsystem name packed in initial_procedure */ 3 82 2 dollar_limit float bin, 3 83 2 dollar_charge float bin, /* total dollars spent this month */ 3 84 2 shift_limit (0: 7) float bin, 3 85 2 daton fixed bin (71), /* date user added to system */ 3 86 2 datof fixed bin (71), /* date user deleted */ 3 87 2 last_login_time fixed bin (71), /* time of last login */ 3 88 2 last_login_unit char (4), /* terminal id last used */ 3 89 2 last_login_type fixed bin (17) unal, /* terminal type */ 3 90 2 last_login_line_type fixed bin (17) unal, /* terminal line type */ 3 91 2 time_last_bump fixed bin (71), /* for bump-wait */ 3 92 2 last_update fixed bin (71), /* time of last transaction */ 3 93 2 logins fixed bin, /* number of logins */ 3 94 2 crashes fixed bin, /* sessions abnormally terminated */ 3 95 2 interactive (0: 7), /* interactive use, shifts 0-7 */ 3 96 3 charge float bin, /* total dollar charge this shift */ 3 97 3 xxx fixed bin, 3 98 3 cpu fixed bin (71), /* cpu usage in microseconds */ 3 99 3 core fixed bin (71), /* core demand in page-microseconds */ 3 100 3 connect fixed bin (71), /* total console time in microseconds */ 3 101 3 io_ops fixed bin (71), /* total i/o ops on terminal */ 3 102 2 absentee (4), /* absentee use, queues 1-4 */ 3 103 3 charge float bin, /* dollar charge this queue */ 3 104 3 jobs fixed bin, /* number of jobs submitted */ 3 105 3 cpu fixed bin (71), /* total cpu time in microseconds */ 3 106 3 memory fixed bin (71), /* total memory demand */ 3 107 2 iod (4), /* io daemon use, queues 1-4 */ 3 108 3 charge float bin, /* dollar charge this queue */ 3 109 3 pieces fixed bin, /* pieces of output requested */ 3 110 3 pad fixed bin (35), 3 111 3 pages fixed bin (35), /* number of pages output */ 3 112 3 lines fixed bin (71), /* total record count of output */ 3 113 2 devices (16) float bin, /* device charges */ 3 114 2 time_last_reset fixed bin (71), /* time PDT last updated */ 3 115 2 absolute_limit float bin, /* Limit, not reset monthly */ 3 116 2 absolute_spent float bin, /* Spending against this */ 3 117 2 absolute_cutoff fixed bin (71), /* Spending will be reset on this date */ 3 118 2 absolute_increm fixed bin, /* .. time increment code. 0 = don't reset */ 3 119 2 pad_was_authorization bit (72) aligned, 3 120 2 group char (8), /* group for this user (if at.igroup = "1"b) */ 3 121 2 warn_days fixed bin (17) unaligned, /* warn user if less than this many days to cutoff */ 3 122 2 warn_pct fixed bin (17) unaligned, /* warn user if less than this percent of funds left */ 3 123 2 warn_dollars float bin, /* warn user if less than this amount of funds left */ 3 124 2 n_foreground fixed bin (9) unsigned unaligned, /* number of foreground and background processes */ 3 125 2 n_background fixed bin (9) unsigned unaligned, /* that this user has. see limits just below */ 3 126 2 max_foreground fixed bin (9) unsigned unaligned, /* max simultaneous foreground and */ 3 127 2 max_background fixed bin (9) unsigned unaligned, /* background processes that this user can have */ 3 128 2 n_interactive fixed bin (9) unsigned unaligned, /* number of interactive processes that user has */ 3 129 2 n_disconnected fixed bin (9) unsigned unaligned, /* number of disconnected processes that user has */ 3 130 2 pdtupad1 fixed bin (18) unsigned unaligned, 3 131 2 user_warn_days fixed bin (17) unaligned, /* warn user if less than this many days to user cutoff */ 3 132 2 user_warn_pct fixed bin (17) unaligned, /* warn user if less than this percent of user funds left */ 3 133 2 user_warn_dollars float bin, /* warn user if less than this amount of user funds left */ 3 134 2 user_authorization (2) bit (72) aligned, /* range */ 3 135 2 pdtupad (5) fixed bin, 3 136 2 abs_foreground_cpu_limit fixed bin (17) unaligned, /* time limit (sec) on foreground absentee jobs */ 3 137 2 pdir_quota fixed bin (17) unaligned, /* quota to put on user's pdir (0 => use default) */ 3 138 2 chain fixed bin; /* free chain */ 3 139 3 140 /* END INCLUDE FILE ... pdt.incl.pl1 */ 68 69 70 /* ====================================================== */ 71 72 join: 73 call ioa_$rsnnl ("^a.pdt", pdt_name, j, proj); /* Fabricate name of pdt wanted. */ 74 75 if ^init then do; /* check the access to the PDT */ 76 77 call hcs_$get_access_class (sysdir, pdt_name, access_class, ec); 78 if ec ^= 0 then go to mode_err; /* hate to, but give up */ 79 80 if read_write_allowed_ (get_authorization_ (), access_class) /* can we read and write? */ 81 then need_priv = "0"b; /* Yes, no privileges needed */ 82 else need_priv = "1"b; /* we need privileges if we are to do anything */ 83 84 init = "1"b; /* only do this once */ 85 86 end; 87 88 on linkage_error go to mode_err; /* play safe each time this is called */ 89 /* in case user has no access to system_privilege_ */ 90 if need_priv then 91 call system_privilege_$initiate (sysdir, pdt_name, "", 0, 1, pdtp, ec); 92 else call hcs_$initiate (sysdir, pdt_name, "", 0, 1, pdtp, ec); 93 if pdtp = null then do; /* Look for pdt. */ 94 code = ec; /* Ugh. */ 95 return; 96 end; 97 98 search: do i = 1 to pdt.current_size; /* Look up user in pdt. */ 99 pdtep = addr (pdt.user (i)); /* Get ptr to entry */ 100 if user.state = 1 then /* Look only at live users. */ 101 if user.person_id = name then go to found; /* Check name. */ 102 end; 103 104 code = 1; /* User is not in pdt. */ 105 go to terminate; /* Error. */ 106 107 found: 108 call set_lock_$lock (user.lock, 300, ec); /* Lock user entry. Wait up to 5 mins. */ 109 if ec = error_table_$lock_wait_time_exceeded then do; 110 code = ec; /* tell caller what happened */ 111 go to terminate; /* and cleanup */ 112 end; 113 114 if setsw then go to force; /* Where did we come in? */ 115 116 user.absolute_spent = user.absolute_spent + dp -> user.absolute_spent; 117 user.dollar_charge = user.dollar_charge + dp -> user.dollar_charge; 118 user.logins = user.logins + dp -> user.logins; 119 user.crashes = user.crashes + dp -> user.crashes; 120 do i = 0 to 7; 121 user.interactive (i).charge = user.interactive (i).charge + dp -> user.interactive (i).charge; 122 user.interactive (i).cpu = user.interactive (i).cpu + dp -> user.interactive (i).cpu; 123 user.interactive (i).core = user.interactive (i).core + dp -> user.interactive (i).core; 124 user.interactive (i).connect = user.interactive (i).connect + dp -> user.interactive (i).connect; 125 user.interactive (i).io_ops = user.interactive (i).io_ops + dp -> user.interactive (i).io_ops; 126 end; 127 do i = 1 to 4; 128 user.absentee (i).charge = user.absentee (i).charge + dp -> user.absentee (i).charge; 129 user.absentee (i).jobs = user.absentee (i).jobs + dp -> user.absentee (i).jobs; 130 user.absentee (i).cpu = user.absentee (i).cpu + dp -> user.absentee (i).cpu; 131 user.absentee (i).memory = user.absentee (i).memory + dp -> user.absentee (i).memory; 132 end; 133 do i = 1 to 4; 134 user.iod (i).charge = user.iod (i).charge + dp -> user.iod (i).charge; 135 user.iod (i).pieces = user.iod (i).pieces + dp -> user.iod (i).pieces; 136 user.iod (i).pages = user.iod (i).pages + dp -> user.iod (i).pages; 137 user.iod (i).lines = user.iod (i).lines + dp -> user.iod (i).lines; 138 end; 139 do i = 1 to 16; 140 user.devices (i) = user.devices (i) + dp -> user.devices (i); 141 end; 142 143 exit: user.last_update = clock_ (); /* Indicate when changes done. */ 144 145 call set_lock_$unlock (user.lock, ec); /* Unlock user. */ 146 code = 0; 147 148 terminate: /* be sure to clean up after ourselves */ 149 call hcs_$terminate_noname (pdtp, ec); /* don't bother with the error code */ 150 return; 151 152 mode_err: code = error_table_$moderr; /* say that we don't have access */ 153 return; 154 155 /* ======================================================== */ 156 157 set_user_charge: entry (name, proj, dp, code); 158 159 /* CHARGE_USER_$SET_USER_CHARGE - same as above but replaces usage meters instead of adding. */ 160 161 setsw = "1"b; /* Indicate type of processing. */ 162 go to join; /* Use common code to find user. */ 163 164 force: user.dollar_charge = dp -> user.dollar_charge; /* Force all variables in pdt to new values. */ 165 user.absolute_spent = dp -> user.absolute_spent; 166 user.logins = dp -> user.logins; 167 user.crashes = dp -> user.crashes; 168 do i = 0 to 7; 169 user.interactive (i).charge = dp -> user.interactive (i).charge; 170 user.interactive (i).cpu = dp -> user.interactive (i).cpu; 171 user.interactive (i).core = dp -> user.interactive (i).core; 172 user.interactive (i).connect = dp -> user.interactive (i).connect; 173 user.interactive (i).io_ops = dp -> user.interactive (i).io_ops; 174 end; 175 do i = 1 to 4; 176 user.absentee (i).charge = dp -> user.absentee (i).charge; 177 user.absentee (i).jobs = dp -> user.absentee (i).jobs; 178 user.absentee (i).cpu = dp -> user.absentee (i).cpu; 179 user.absentee (i).memory = dp -> user.absentee (i).memory; 180 end; 181 do i = 1 to 4; 182 user.iod (i).charge = dp -> user.iod (i).charge; 183 user.iod (i).pieces = dp -> user.iod (i).pieces; 184 user.iod (i).pages = dp -> user.iod (i).pages; 185 user.iod (i).lines = dp -> user.iod (i).lines; 186 end; 187 do i = 1 to 16; 188 user.devices (i) = dp -> user.devices (i); 189 end; 190 191 go to exit; 192 193 /* ==================================================== */ 194 195 debug: entry (dirn); 196 197 dcl dirn char (*); 198 199 sysdir = dirn; 200 init = "0"b; /* be sure we check access again */ 201 return; 202 203 end charge_user_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/29/88 0858.8 charge_user_.pl1 >spec>install>1093>charge_user_.pl1 67 1 08/06/87 0913.6 user_attributes.incl.pl1 >ldd>include>user_attributes.incl.pl1 1-112 2 07/14/88 2015.0 user_abs_attributes.incl.pl1 >ldd>include>user_abs_attributes.incl.pl1 68 3 09/13/84 0921.6 pdt.incl.pl1 >ldd>include>pdt.incl.pl1 3-29 4 04/21/82 1211.8 author.incl.pl1 >ldd>include>author.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. absentee 244 based structure array level 2 dcl 3-58 absolute_spent 347 based float bin(27) level 2 dcl 3-58 set ref 116* 116 116 165* 165 access_class 000120 automatic bit(72) dcl 36 set ref 77* 80* addr builtin function dcl 65 ref 99 charge 244 based float bin(27) array level 3 in structure "user" dcl 3-58 in procedure "charge_user_" set ref 128* 128 128 176* 176 charge 124 based float bin(27) array level 3 in structure "user" dcl 3-58 in procedure "charge_user_" set ref 121* 121 121 169* 169 charge 274 based float bin(27) array level 3 in structure "user" dcl 3-58 in procedure "charge_user_" set ref 134* 134 134 182* 182 clock_ 000104 constant entry external dcl 52 ref 143 code parameter fixed bin(35,0) dcl 31 set ref 12 94* 104* 110* 146* 152* 157 connect 132 based fixed bin(71,0) array level 3 dcl 3-58 set ref 124* 124 124 172* 172 core 130 based fixed bin(71,0) array level 3 dcl 3-58 set ref 123* 123 123 171* 171 cpu 246 based fixed bin(71,0) array level 3 in structure "user" dcl 3-58 in procedure "charge_user_" set ref 130* 130 130 178* 178 cpu 126 based fixed bin(71,0) array level 3 in structure "user" dcl 3-58 in procedure "charge_user_" set ref 122* 122 122 170* 170 crashes 123 based fixed bin(17,0) level 2 dcl 3-58 set ref 119* 119 119 167* 167 current_size 36 based fixed bin(17,0) level 2 dcl 3-27 ref 98 devices 324 based float bin(27) array level 2 dcl 3-58 set ref 140* 140 140 188* 188 dirn parameter char packed unaligned dcl 197 ref 195 199 dollar_charge 75 based float bin(27) level 2 dcl 3-58 set ref 117* 117 117 164* 164 dp parameter pointer dcl 31 ref 12 116 117 118 119 121 122 123 124 125 128 129 130 131 134 135 136 137 140 157 164 165 166 167 169 170 171 172 173 176 177 178 179 182 183 184 185 188 ec 000117 automatic fixed bin(35,0) dcl 36 set ref 77* 78 90* 92* 94 107* 109 110 145* 148* error_table_$lock_wait_time_exceeded 000064 external static fixed bin(35,0) dcl 45 ref 109 error_table_$moderr 000066 external static fixed bin(35,0) dcl 45 ref 152 get_authorization_ 000100 constant entry external dcl 52 ref 80 80 hcs_$get_access_class 000074 constant entry external dcl 52 ref 77 hcs_$initiate 000072 constant entry external dcl 52 ref 92 hcs_$terminate_noname 000112 constant entry external dcl 52 ref 148 i 000114 automatic fixed bin(17,0) dcl 36 set ref 98* 99* 120* 121 121 121 122 122 122 123 123 123 124 124 124 125 125 125* 127* 128 128 128 129 129 129 130 130 130 131 131 131* 133* 134 134 134 135 135 135 136 136 136 137 137 137* 139* 140 140 140* 168* 169 169 170 170 171 171 172 172 173 173* 175* 176 176 177 177 178 178 179 179* 181* 182 182 183 183 184 184 185 185* 187* 188 188* init 000010 internal static bit(1) initial dcl 36 set ref 75 84* 200* interactive 124 based structure array level 2 dcl 3-58 io_ops 134 based fixed bin(71,0) array level 3 dcl 3-58 set ref 125* 125 125 173* 173 ioa_$rsnnl 000070 constant entry external dcl 52 ref 72 iod 274 based structure array level 2 dcl 3-58 j 000115 automatic fixed bin(17,0) dcl 36 set ref 72* jobs 245 based fixed bin(17,0) array level 3 dcl 3-58 set ref 129* 129 129 177* 177 last_update 120 based fixed bin(71,0) level 2 dcl 3-58 set ref 143* lines 300 based fixed bin(71,0) array level 3 dcl 3-58 set ref 137* 137 137 185* 185 linkage_error 000122 stack reference condition dcl 48 ref 88 lock 1 based bit(36) level 2 dcl 3-58 set ref 107* 145* logins 122 based fixed bin(17,0) level 2 dcl 3-58 set ref 118* 118 118 166* 166 memory 250 based fixed bin(71,0) array level 3 dcl 3-58 set ref 131* 131 131 179* 179 name parameter char packed unaligned dcl 31 ref 12 100 157 need_priv 000011 internal static bit(1) initial dcl 36 set ref 80* 82* 90 null builtin function dcl 65 ref 93 pages 277 based fixed bin(35,0) array level 3 dcl 3-58 set ref 136* 136 136 184* 184 pdt based structure level 1 dcl 3-27 pdt_name 000104 automatic char(32) dcl 36 set ref 72* 77* 90* 92* pdtep 000102 automatic pointer dcl 36 set ref 99* 100 100 107 116 116 117 117 118 118 119 119 121 121 122 122 123 123 124 124 125 125 128 128 129 129 130 130 131 131 134 134 135 135 136 136 137 137 140 140 143 145 164 165 166 167 169 170 171 172 173 176 177 178 179 182 183 184 185 188 pdtp 000100 automatic pointer dcl 36 set ref 90* 92* 93 98 99 148* person_id 2 based char(24) level 2 dcl 3-58 ref 100 pieces 275 based fixed bin(17,0) array level 3 dcl 3-58 set ref 135* 135 135 183* 183 proj parameter char packed unaligned dcl 31 set ref 12 72* 157 read_write_allowed_ 000102 constant entry external dcl 52 ref 80 set_lock_$lock 000106 constant entry external dcl 52 ref 107 set_lock_$unlock 000110 constant entry external dcl 52 ref 145 setsw 000116 automatic bit(1) initial dcl 36 set ref 36* 114 161* state based fixed bin(17,0) level 2 dcl 3-58 ref 100 sysdir 000012 internal static char(168) initial dcl 50 set ref 77* 90* 92* 199* system_privilege_$initiate 000076 constant entry external dcl 52 ref 90 user based structure level 1 dcl 3-58 in procedure "charge_user_" user 400 based structure array level 2 in structure "pdt" dcl 3-27 in procedure "charge_user_" set ref 99 user_attributes based structure level 1 dcl 1-21 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ABS_ATTRIBUTE_NAMES internal static varying char(28) initial array dcl 2-38 ALT_USER_ATTRIBUTE_NAMES internal static char(20) initial array packed unaligned dcl 1-77 PDT_entry_lth internal static fixed bin(17,0) initial dcl 3-19 PDT_header_lth internal static fixed bin(17,0) initial dcl 3-19 PDT_person_id_length internal static fixed bin(17,0) initial dcl 3-19 PDT_project_name_length internal static fixed bin(17,0) initial dcl 3-19 PDT_version internal static fixed bin(17,0) initial dcl 3-19 USER_ATTRIBUTES_always_allowed internal static bit(36) initial dcl 1-100 USER_ATTRIBUTES_default_in_pdt internal static bit(36) initial dcl 1-104 USER_ATTRIBUTES_settable_by_user internal static bit(36) initial dcl 1-108 USER_ATTRIBUTE_NAMES internal static char(20) initial array packed unaligned dcl 1-50 user_abs_attributes based structure level 1 dcl 2-25 NAMES DECLARED BY EXPLICIT CONTEXT. charge_user_ 000037 constant entry external dcl 12 debug 001030 constant entry external dcl 195 exit 000575 constant label dcl 143 ref 191 force 000666 constant label dcl 164 ref 114 found 000374 constant label dcl 107 ref 100 join 000060 constant label dcl 72 ref 162 mode_err 000633 constant label dcl 152 ref 78 88 search 000340 constant label dcl 98 set_user_charge 000642 constant entry external dcl 157 terminate 000621 constant label dcl 148 set ref 105 111 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1260 1374 1055 1270 Length 1652 1055 114 242 203 54 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME charge_user_ 146 external procedure is an external procedure. on unit on line 88 64 on unit STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 init charge_user_ 000011 need_priv charge_user_ 000012 sysdir charge_user_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME charge_user_ 000100 pdtp charge_user_ 000102 pdtep charge_user_ 000104 pdt_name charge_user_ 000114 i charge_user_ 000115 j charge_user_ 000116 setsw charge_user_ 000117 ec charge_user_ 000120 access_class charge_user_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac tra_ext_1 enable_op ext_entry_desc int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ get_authorization_ hcs_$get_access_class hcs_$initiate hcs_$terminate_noname ioa_$rsnnl read_write_allowed_ set_lock_$lock set_lock_$unlock system_privilege_$initiate THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$lock_wait_time_exceeded error_table_$moderr LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 36 000027 12 000032 72 000060 75 000111 77 000114 78 000140 80 000142 82 000172 84 000175 88 000177 90 000216 92 000265 93 000330 94 000334 95 000337 98 000340 99 000351 100 000354 102 000366 104 000370 105 000373 107 000374 109 000411 110 000415 111 000417 114 000420 116 000422 117 000431 118 000434 119 000436 120 000440 121 000445 122 000456 123 000461 124 000464 125 000467 126 000472 127 000474 128 000501 129 000512 130 000514 131 000517 132 000522 133 000524 134 000531 135 000542 136 000544 137 000550 138 000553 139 000555 140 000563 141 000573 143 000575 145 000605 146 000617 148 000621 150 000632 152 000633 153 000637 157 000640 161 000663 162 000665 164 000666 165 000674 166 000676 167 000700 168 000702 169 000707 170 000717 171 000721 172 000723 173 000725 174 000727 175 000731 176 000737 177 000747 178 000751 179 000753 180 000755 181 000757 182 000765 183 000775 184 000777 185 001001 186 001003 187 001005 188 001013 189 001022 191 001024 195 001025 199 001044 200 001053 201 001054 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved