COMPILATION LISTING OF SEGMENT attach_audit Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1648.6 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 /* format: style2,ind3 */ 12 attach_audit: 13 ata: 14 proc; 15 16 /* This module turns on auditing for the calling process. IF 17* no arguments are given, it generates default switchnames, and audit_ 18* is set up with no arguments. 19* 20* Written 1/1/79 by Lindsey L. Spratt 21* Modified: 22* 11/26/79 by Lindsey L. Spratt to implement the -modes control argument. 23*06/05/81 by Lindsey Spratt: Changed error message for non-zero code when 24* trying to attach audit_ to the old switch to give the attach 25* description being attempted. Changed the error code from 26* bad_arg to badopt when more than one mode string is specified. 27*09/09/81 by Lindsey Spratt: Added a check of arguments being placed in the 28* attach description "ad". This allows more elegant error reporting 29* than the "argerr" produced by audit_. This fixes bug 9. 30*11/12/81 by Lindsey Spratt: Made all error messages start with a newline. 31* Changed the argument index variable from "i" to "arg_idx". 32**/ 33 34 /* Automatic */ 35 36 dcl nargs fixed bin; 37 dcl arg_idx fixed bin; 38 dcl tp ptr; 39 dcl tc fixed bin; 40 dcl (code, code1) fixed bin (35); 41 dcl ad char (128) varying; 42 dcl mode_string char (256) varying init (""); 43 dcl old_modes char (256) init (""); 44 dcl (old_switch, new_switch) 45 char (32); 46 dcl (old_iocb, new_iocb) ptr; 47 dcl (have_old_iocb, have_new_iocb) 48 bit (1); 49 dcl time char (16); 50 51 /* Based */ 52 53 dcl targ char (tc) based (tp); 54 55 /* Builtins */ 56 57 dcl clock builtin; 58 dcl codeptr builtin; 59 dcl rtrim builtin; 60 dcl substr builtin; 61 62 /* Constant */ 63 64 dcl MYNAME char (12) init ("attach_audit") internal static options (constant); 65 66 /* Entries */ 67 68 dcl date_time_ entry (fixed bin (71), char (*)); 69 dcl cu_$arg_count entry (fixed bin); 70 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 71 dcl com_err_ entry options (variable); 72 73 74 /* External */ 75 76 dcl error_table_$badopt fixed bin (35) ext; 77 78 79 have_old_iocb = "0"b; 80 have_new_iocb = "0"b; 81 82 ad = " "; 83 call cu_$arg_count (nargs); 84 85 86 do arg_idx = 1 to nargs; 87 call cu_$arg_ptr (arg_idx, tp, tc, code); 88 if code ^= 0 89 then 90 do; 91 call com_err_ (code, MYNAME, "^/Unable to get argument ^d.", arg_idx); 92 return; 93 end; 94 95 if index (targ, "-") = 1 96 then if targ = "-modes" 97 then if mode_string = "" 98 then 99 do; 100 arg_idx = arg_idx + 1; 101 call cu_$arg_ptr (arg_idx, tp, tc, code); 102 if code ^= 0 103 then 104 do; 105 call com_err_ (code, MYNAME, "^/No mode string followed the -modes control argument."); 106 return; 107 end; 108 mode_string = targ; 109 end; 110 else 111 do; 112 call com_err_ (error_table_$badopt, MYNAME, "^/Only one mode string may be given."); 113 return; 114 end; 115 else if targ = "-pn" | targ = "-pathname" | targ = "-tc" | targ = "-truncate" 116 then ad = ad || targ || " "; 117 else 118 do; 119 call com_err_ (error_table_$badopt, MYNAME, "^/^a is not a known control argument.", targ); 120 return; 121 end; 122 else if arg_idx = 1 123 then 124 do; 125 old_switch = targ; 126 call iox_$look_iocb (old_switch, old_iocb, code); 127 if code ^= 0 128 then 129 do; 130 call com_err_ (code, MYNAME, "^/Unable to find the switch named ^a.", old_switch); 131 return; 132 end; 133 have_old_iocb = "1"b; 134 end; 135 else if arg_idx ^= 2 136 then ad = ad || targ || " "; 137 else if have_old_iocb 138 then 139 do; 140 new_switch = targ; 141 call iox_$find_iocb (new_switch, new_iocb, code); 142 if code ^= 0 143 then 144 do; 145 call com_err_ (code, MYNAME, "^/Unable to find or create the new switch named ^a.", new_switch); 146 return; 147 end; 148 have_new_iocb = "1"b; 149 end; 150 else ad = ad || targ || " "; 151 end; 152 153 if ^have_new_iocb 154 then 155 do; 156 call date_time_ (clock, time); 157 new_switch = "audit_i/o." || substr (time, 11, 6); 158 call iox_$find_iocb (new_switch, new_iocb, code); 159 if code ^= 0 160 then 161 do; 162 call 163 com_err_ (code, MYNAME, "^/Unable to find or create the new switch with default switchname ^a.", 164 new_switch); 165 return; 166 end; 167 end; 168 169 if ^have_old_iocb 170 then 171 do; 172 old_switch = "user_i/o"; 173 call iox_$look_iocb (old_switch, old_iocb, code); 174 if code ^= 0 175 then 176 do; 177 call com_err_ (code, MYNAME, "^/Unable to find the switch to be audited ^a.", old_switch); 178 return; 179 end; 180 end; 181 182 ad = "audit_ " || rtrim (new_switch) || " " || ad; 183 184 call iox_$move_attach (old_iocb, new_iocb, code); 185 if code ^= 0 186 then 187 do; 188 call com_err_ (code, MYNAME, "^/Unable to move attachment from ^a to ^a", old_switch, new_switch); 189 return; 190 end; 191 192 call iox_$attach_ptr (old_iocb, (ad), codeptr (attach_audit), code); 193 if code ^= 0 194 then 195 do; 196 call iox_$detach_iocb (old_iocb, code1); 197 call iox_$move_attach (new_iocb, old_iocb, code1); 198 call 199 com_err_ (code, MYNAME, "^/Unable to attach audit_ to switch ^a, using the attach description ""^a"".", 200 old_switch, ad); 201 return; 202 end; 203 call iox_$modes (old_iocb, (mode_string), old_modes, code); 204 return; 205 206 /* Include */ 207 1 1 /* --------------- BEGIN include file iox_dcls.incl.pl1 --------------- */ 1 2 1 3 /* Written 05/04/78 by C. D. Tavares */ 1 4 /* Fixed declaration of iox_$find_iocb_n 05/07/80 by R. Holmstedt */ 1 5 1 6 dcl iox_$attach_name entry (char (*), pointer, char (*), pointer, fixed bin (35)), 1 7 iox_$attach_ptr entry (pointer, char (*), pointer, fixed bin (35)), 1 8 iox_$close entry (pointer, fixed bin (35)), 1 9 iox_$control entry (pointer, char (*), pointer, fixed bin (35)), 1 10 iox_$delete_record entry (pointer, fixed bin (35)), 1 11 iox_$destroy_iocb entry (pointer, fixed bin (35)), 1 12 iox_$detach_iocb entry (pointer, fixed bin (35)), 1 13 iox_$err_not_attached entry options (variable), 1 14 iox_$err_not_closed entry options (variable), 1 15 iox_$err_no_operation entry options (variable), 1 16 iox_$err_not_open entry options (variable), 1 17 iox_$find_iocb entry (char (*), pointer, fixed bin (35)), 1 18 iox_$find_iocb_n entry (fixed bin, ptr, fixed bin(35)), 1 19 iox_$get_chars entry (pointer, pointer, fixed bin (21), fixed bin (21), fixed bin (35)), 1 20 iox_$get_line entry (pointer, pointer, fixed bin (21), fixed bin (21), fixed bin (35)), 1 21 iox_$look_iocb entry (char (*), pointer, fixed bin (35)), 1 22 iox_$modes entry (pointer, char (*), char (*), fixed bin (35)), 1 23 iox_$move_attach entry (pointer, pointer, fixed bin (35)), 1 24 iox_$open entry (pointer, fixed bin, bit (1) aligned, fixed bin (35)), 1 25 iox_$position entry (pointer, fixed bin, fixed bin (21), fixed bin (35)), 1 26 iox_$propagate entry (pointer), 1 27 iox_$put_chars entry (pointer, pointer, fixed bin (21), fixed bin (35)), 1 28 iox_$read_key entry (pointer, char (256) varying, fixed bin (21), fixed bin (35)), 1 29 iox_$read_length entry (pointer, fixed bin (21), fixed bin (35)), 1 30 iox_$read_record entry (pointer, pointer, fixed bin (21), fixed bin (21), fixed bin (35)), 1 31 iox_$rewrite_record entry (pointer, pointer, fixed bin (21), fixed bin (35)), 1 32 iox_$seek_key entry (pointer, char (256) varying, fixed bin (21), fixed bin (35)), 1 33 iox_$write_record entry (pointer, pointer, fixed bin (21), fixed bin (35)) ; 1 34 1 35 dcl (iox_$user_output, 1 36 iox_$user_input, 1 37 iox_$user_io, 1 38 iox_$error_output) external static pointer; 1 39 1 40 /* ---------------- END include file iox_dcls.incl.pl1 ---------------- */ 208 209 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1605.2 attach_audit.pl1 >dumps>old>recomp>attach_audit.pl1 208 1 07/22/80 1335.1 iox_dcls.incl.pl1 >ldd>include>iox_dcls.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. MYNAME 000000 constant char(12) initial unaligned dcl 64 set ref 91* 105* 112* 119* 130* 145* 162* 177* 188* 198* ad 000107 automatic varying char(128) dcl 41 set ref 82* 115* 115 135* 135 150* 150 182* 182 192 198* arg_idx 000101 automatic fixed bin(17,0) dcl 37 set ref 86* 87* 91* 100* 100 101* 122 135* clock builtin function dcl 57 ref 156 156 code 000105 automatic fixed bin(35,0) dcl 40 set ref 87* 88 91* 101* 102 105* 126* 127 130* 141* 142 145* 158* 159 162* 173* 174 177* 184* 185 188* 192* 193 198* 203* code1 000106 automatic fixed bin(35,0) dcl 40 set ref 196* 197* codeptr builtin function dcl 58 ref 192 192 com_err_ 000016 constant entry external dcl 71 ref 91 105 112 119 130 145 162 177 188 198 cu_$arg_count 000012 constant entry external dcl 69 ref 83 cu_$arg_ptr 000014 constant entry external dcl 70 ref 87 101 date_time_ 000010 constant entry external dcl 68 ref 156 error_table_$badopt 000020 external static fixed bin(35,0) dcl 76 set ref 112* 119* have_new_iocb 000377 automatic bit(1) unaligned dcl 47 set ref 80* 148* 153 have_old_iocb 000376 automatic bit(1) unaligned dcl 47 set ref 79* 133* 137 169 iox_$attach_ptr 000022 constant entry external dcl 1-6 ref 192 iox_$detach_iocb 000024 constant entry external dcl 1-6 ref 196 iox_$find_iocb 000026 constant entry external dcl 1-6 ref 141 158 iox_$look_iocb 000030 constant entry external dcl 1-6 ref 126 173 iox_$modes 000032 constant entry external dcl 1-6 ref 203 iox_$move_attach 000034 constant entry external dcl 1-6 ref 184 197 mode_string 000150 automatic varying char(256) initial dcl 42 set ref 42* 95 108* 203 nargs 000100 automatic fixed bin(17,0) dcl 36 set ref 83* 86 new_iocb 000374 automatic pointer dcl 46 set ref 141* 158* 184* 197* new_switch 000361 automatic char(32) unaligned dcl 44 set ref 140* 141* 145* 157* 158* 162* 182 188* old_iocb 000372 automatic pointer dcl 46 set ref 126* 173* 184* 192* 196* 197* 203* old_modes 000251 automatic char(256) initial unaligned dcl 43 set ref 43* 203* old_switch 000351 automatic char(32) unaligned dcl 44 set ref 125* 126* 130* 172* 173* 177* 188* 198* rtrim builtin function dcl 59 ref 182 substr builtin function dcl 60 ref 157 targ based char unaligned dcl 53 set ref 95 95 108 115 115 115 115 115 119* 125 135 140 150 tc 000104 automatic fixed bin(17,0) dcl 39 set ref 87* 95 95 101* 108 115 115 115 115 115 119 119 125 135 140 150 time 000400 automatic char(16) unaligned dcl 49 set ref 156* 157 tp 000102 automatic pointer dcl 38 set ref 87* 95 95 101* 108 115 115 115 115 115 119 125 135 140 150 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. iox_$attach_name 000000 constant entry external dcl 1-6 iox_$close 000000 constant entry external dcl 1-6 iox_$control 000000 constant entry external dcl 1-6 iox_$delete_record 000000 constant entry external dcl 1-6 iox_$destroy_iocb 000000 constant entry external dcl 1-6 iox_$err_no_operation 000000 constant entry external dcl 1-6 iox_$err_not_attached 000000 constant entry external dcl 1-6 iox_$err_not_closed 000000 constant entry external dcl 1-6 iox_$err_not_open 000000 constant entry external dcl 1-6 iox_$error_output external static pointer dcl 1-35 iox_$find_iocb_n 000000 constant entry external dcl 1-6 iox_$get_chars 000000 constant entry external dcl 1-6 iox_$get_line 000000 constant entry external dcl 1-6 iox_$open 000000 constant entry external dcl 1-6 iox_$position 000000 constant entry external dcl 1-6 iox_$propagate 000000 constant entry external dcl 1-6 iox_$put_chars 000000 constant entry external dcl 1-6 iox_$read_key 000000 constant entry external dcl 1-6 iox_$read_length 000000 constant entry external dcl 1-6 iox_$read_record 000000 constant entry external dcl 1-6 iox_$rewrite_record 000000 constant entry external dcl 1-6 iox_$seek_key 000000 constant entry external dcl 1-6 iox_$user_input external static pointer dcl 1-35 iox_$user_io external static pointer dcl 1-35 iox_$user_output external static pointer dcl 1-35 iox_$write_record 000000 constant entry external dcl 1-6 NAMES DECLARED BY EXPLICIT CONTEXT. ata 000254 constant entry external dcl 12 attach_audit 000264 constant entry external dcl 12 ref 192 192 NAME DECLARED BY CONTEXT OR IMPLICATION. index builtin function ref 95 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1742 2000 1602 1752 Length 2206 1602 36 172 137 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ata 376 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ata 000100 nargs ata 000101 arg_idx ata 000102 tp ata 000104 tc ata 000105 code ata 000106 code1 ata 000107 ad ata 000150 mode_string ata 000251 old_modes ata 000351 old_switch ata 000361 new_switch ata 000372 old_iocb ata 000374 new_iocb ata 000376 have_old_iocb ata 000377 have_new_iocb ata 000400 time ata THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry clock THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_count cu_$arg_ptr date_time_ iox_$attach_ptr iox_$detach_iocb iox_$find_iocb iox_$look_iocb iox_$modes iox_$move_attach THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 42 000245 43 000246 12 000253 79 000272 80 000273 82 000274 83 000300 86 000307 87 000316 88 000333 91 000335 92 000365 95 000366 100 000413 101 000414 102 000431 105 000433 106 000457 108 000460 109 000471 112 000472 113 000516 114 000517 115 000520 117 000574 119 000575 120 000630 121 000631 122 000632 125 000635 126 000640 127 000661 130 000663 131 000713 133 000714 134 000716 135 000717 137 000755 140 000760 141 000763 142 001004 145 001006 146 001036 148 001037 149 001041 150 001042 151 001075 153 001100 156 001102 157 001121 158 001134 159 001156 162 001160 165 001210 169 001211 172 001213 173 001216 174 001237 177 001241 178 001271 182 001272 184 001346 185 001362 188 001364 189 001417 192 001420 193 001456 196 001461 197 001472 198 001505 201 001541 203 001542 204 001577 ----------------------------------------------------------- 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