COMPILATION LISTING OF SEGMENT fs_move Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1046.8 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1984 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 /* format: style4 */ 14 fs_move: proc; 15 16 /* Modified by E. Stone 8/73 to convert to version 2 and to check the max length of the TO segment */ 17 /* Modified January 1983 by Keith Loepere so as to truncate target AFTER 18* all validations */ 19 /* Modified February 1983 by E. N. Kittlitz for 256K segments */ 20 /* Modified November 1984 by Keith Loepere to rename terminate to terminate_ */ 21 22 ffile: entry (a_dirname_from, a_ename_from, a_sw, a_dirname_to, a_ename_to, a_code); 23 24 dcl a_dirname_from char (*); 25 dcl a_dirname_to char (*); 26 dcl a_ename_from char (*); 27 dcl a_ename_to char (*); 28 dcl a_sw fixed bin (2); 29 dcl a_code fixed bin (35); 30 31 dcl created_seg bit (1) aligned; 32 dcl dirname_from char (168); 33 dcl dirname_to char (168); 34 dcl ename_from char (32); 35 dcl ename_to char (32); 36 dcl curlen fixed bin; 37 dcl ldirname_from fixed bin; 38 dcl ldirname_to fixed bin; 39 dcl target_len bit (12); 40 dcl entry_point fixed bin; 41 dcl options bit (2) unaligned; 42 dcl append_sw bit (1) unaligned def (options) pos (1); 43 dcl truncate_sw bit (1) unaligned def (options) pos (2); 44 dcl max_length fixed bin (19); 45 dcl words fixed bin (19); 46 dcl tcode fixed bin (35); 47 dcl code fixed bin (35); 48 dcl ptr_from ptr; 49 dcl ptr_to ptr; 50 dcl dptr ptr; 51 52 dcl copy (words) bit (36) aligned based; 53 54 dcl file fixed bin static init (0) options (constant); 55 dcl seg fixed bin static init (1) options (constant); 56 57 dcl error_table_$noentry fixed bin (35) ext static; 58 dcl error_table_$segknown fixed bin (35) ext static; 59 dcl error_table_$clnzero fixed bin (35) ext static; 60 dcl error_table_$no_s_permission fixed bin (35) ext static; 61 dcl error_table_$no_move fixed bin (35) external; 62 63 dcl append$branch entry (char (*), char (*), fixed bin (5), fixed bin (35)); 64 dcl fs_get$path_name entry (ptr, char (*), fixed bin, char (*), fixed bin (35)); 65 dcl status_$get_max_length_ptr entry (ptr, fixed bin (19), fixed bin (35)); 66 dcl initiate entry (char (*), char (*), char (*), fixed bin (1), fixed bin (2), ptr, fixed bin (35)); 67 dcl status_$long entry (char (*), char (*), fixed bin (1), ptr, ptr, fixed bin (35)); 68 dcl terminate_$noname entry (ptr, fixed bin (35)); 69 dcl truncate$trseg entry (ptr, fixed bin, fixed bin (35)); 70 dcl quota$check_file entry (char (*), char (*), fixed bin, fixed bin (35)); 71 dcl set$max_length_path entry (char (*), char (*), fixed bin (19), fixed bin (35)); 72 73 dcl (addr, bit, fixed, null) builtin; 74 75 dcl 1 lbranch aligned, /* structure to return long branch status */ 76 (2 (type bit (2), nnames bit (16), nrp bit (18)), 77 2 dtm bit (36), 78 2 dtu bit (36), 79 2 (mode bit (5), pad1 bit (13), records bit (18)), 80 2 dtd bit (36), /* date time file and branch dumped */ 81 2 dtem bit (36), /* date time branch modified */ 82 2 acct bit (36), /* account number to which storage is charged */ 83 2 (curlen bit (12), bitcnt bit (24)), /* highest 1024-word block used, bit count */ 84 2 (did bit (4), mdid bit (4), copysw bit (1), pad3 bit (9), rbs (0:2) bit (6)), 85 2 uid bit (36)) unaligned; 86 87 88 entry_point = file; /* indicate that entry was via pathname entry point */ 89 dirname_from = a_dirname_from; /* copy arguments */ 90 ename_from = a_ename_from; 91 dirname_to = a_dirname_to; 92 ename_to = a_ename_to; 93 options = bit (a_sw, 2); /* get options user has requested */ 94 created_seg = "0"b; /* we didn't make output segment */ 95 code, tcode = 0; /* initialize status codes */ 96 97 call initiate (dirname_from, ename_from, "", 0, 0, ptr_from, code); 98 /* get pointer to FROM segment */ 99 100 if code ^= 0 then if code ^= error_table_$segknown then go to fin0; 101 102 try2: call initiate (dirname_to, ename_to, "", 0, 0, ptr_to, code); 103 /* get pointer to TO segment */ 104 105 if code ^= 0 then if code ^= error_table_$segknown then do; 106 /* if TO segment does not exist */ 107 if created_seg then do; 108 if code = 0 then code = error_table_$no_move; 109 go to fin1; 110 end; 111 if code = error_table_$noentry then do; 112 if append_sw then do; /* if append option given, try to make new TO seg */ 113 created_seg = "1"b; /* first try to create */ 114 call status_$get_max_length_ptr (ptr_from, max_length, code); /* get max length of FROM segment */ 115 if code ^= 0 then go to fin1; 116 call append$branch (dirname_to, ename_to, 01011b, code); 117 if code ^= 0 then go to fin1; /* boo hoo */ 118 call set$max_length_path (dirname_to, ename_to, max_length, code); 119 if code = 0 then go to try2; 120 end; 121 end; 122 go to fin1; /* unable to initiate TO seg or unable to create it */ 123 end; 124 go to common; 125 126 fseg: entry (a_ptr_from, a_ptr_to, a_sw, a_code); 127 128 dcl (a_ptr_from, a_ptr_to) ptr; 129 130 entry_point = seg; /* indicate that entry was via the pointer entry point */ 131 ptr_from = a_ptr_from; /* copy arguments */ 132 ptr_to = a_ptr_to; 133 options = bit (a_sw, 2); /* get options user has requested */ 134 code, tcode = 0; /* initialize status codes */ 135 136 call fs_get$path_name (ptr_from, dirname_from, ldirname_from, ename_from, code); 137 /* get pathname of FROM segment */ 138 139 if code ^= 0 then go to fin0; 140 141 call fs_get$path_name (ptr_to, dirname_to, ldirname_to, ename_to, code); 142 /* get pathname of TO sement */ 143 144 if code ^= 0 then go to fin0; 145 146 common: 147 dptr = addr (lbranch); /* get pointer to storage for status_ info */ 148 149 call status_$long (dirname_to, ename_to, 1, dptr, null, code); 150 /* get status info on TO segment */ 151 152 if code ^= 0 then 153 if code = error_table_$no_s_permission then code = 0; /* non fatal error */ 154 else go to fin2; /* serious error */ 155 target_len = lbranch.curlen; /* save for later chec */ 156 157 if lbranch.type ^= "01"b then do; /* make sure that entry is a segment */ 158 badmove: code = error_table_$no_move; 159 go to fin2; 160 end; 161 162 if (lbranch.mode & "01010"b) ^= "01010"b then go to badmove; /* need RW on TO segment */ 163 164 call status_$long (dirname_from, ename_from, 1, dptr, null, code); 165 /* get status info on FROM segment */ 166 167 if code ^= 0 then 168 if code = error_table_$no_s_permission then code = 0; /* non fatal error */ 169 else go to fin2; /* serious error */ 170 171 if lbranch.type ^= "01"b then go to badmove; /* make sure that entry is a segment */ 172 173 if (lbranch.mode & "01000"b) = "0"b then go to badmove; /* need R on FROM segment */ 174 175 curlen = fixed (lbranch.curlen, 12); /* save current length in pages of FROM segment */ 176 words = curlen * 1024; /* get number of words of FROM segment */ 177 178 call status_$get_max_length_ptr (ptr_to, max_length, code); /* get max length of TO segment */ 179 if code ^= 0 then go to badmove; 180 if words > max_length then go to badmove; /* make sure that TO segment has big enough max length */ 181 182 call quota$check_file (dirname_to, ename_to, curlen, code); 183 /* make sure that there is enough quota to perform the copy */ 184 185 if code ^= 0 then go to badmove; /* it wont fit */ 186 187 if target_len then /* if TO seg has non-zero length */ 188 if truncate_sw then do; /* and if truncate option given, truncate TO seg */ 189 call truncate$trseg (ptr_to, 0, code); 190 if code ^= 0 then go to fin2; 191 end; 192 else do; /* and if truncate option not given, return status code */ 193 code = error_table_$clnzero; 194 go to fin2; 195 end; 196 197 ptr_to -> copy = ptr_from -> copy; /* copy FROM segment to TO segment */ 198 199 call truncate$trseg (ptr_from, 0, code); /* truncate FROM segment */ 200 201 fin2: if entry_point = seg then go to fin0; /* if entered via pointer entry, skip terminating segs */ 202 call terminate_$noname (ptr_to, tcode); /* terminate TO seg */ 203 if tcode ^= 0 then go to fin0; 204 fin1: if entry_point = seg then go to fin0; 205 call terminate_$noname (ptr_from, tcode); /* terminate FROM seg */ 206 207 fin0: if tcode ^= 0 then a_code = tcode; 208 else a_code = code; 209 210 return; 211 212 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0800.4 fs_move.pl1 >spec>install>1110>fs_move.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. a_code parameter fixed bin(35,0) dcl 29 set ref 22 126 207* 208* a_dirname_from parameter char packed unaligned dcl 24 ref 22 89 a_dirname_to parameter char packed unaligned dcl 25 ref 22 91 a_ename_from parameter char packed unaligned dcl 26 ref 22 90 a_ename_to parameter char packed unaligned dcl 27 ref 22 92 a_ptr_from parameter pointer dcl 128 ref 126 131 a_ptr_to parameter pointer dcl 128 ref 126 132 a_sw parameter fixed bin(2,0) dcl 28 ref 22 93 126 133 addr builtin function dcl 73 ref 146 append$branch 000022 constant entry external dcl 63 ref 116 append_sw defined bit(1) packed unaligned dcl 42 ref 112 bit builtin function dcl 73 ref 93 133 code 000256 automatic fixed bin(35,0) dcl 47 set ref 95* 97* 100 100 102* 105 105 108 108* 111 114* 115 116* 117 118* 119 134* 136* 139 141* 144 149* 152 152 152* 158* 164* 167 167 167* 178* 179 182* 185 189* 190 193* 199* 208 copy based bit(36) array dcl 52 set ref 197* 197 created_seg 000100 automatic bit(1) dcl 31 set ref 94* 107 113* curlen 000245 automatic fixed bin(17,0) dcl 36 in procedure "fs_move" set ref 175* 176 182* curlen 7 000266 automatic bit(12) level 2 in structure "lbranch" packed packed unaligned dcl 75 in procedure "fs_move" set ref 155 175 dirname_from 000101 automatic char(168) packed unaligned dcl 32 set ref 89* 97* 136* 164* dirname_to 000153 automatic char(168) packed unaligned dcl 33 set ref 91* 102* 116* 118* 141* 149* 182* dptr 000264 automatic pointer dcl 50 set ref 146* 149* 164* ename_from 000225 automatic char(32) packed unaligned dcl 34 set ref 90* 97* 136* 164* ename_to 000235 automatic char(32) packed unaligned dcl 35 set ref 92* 102* 116* 118* 141* 149* 182* entry_point 000251 automatic fixed bin(17,0) dcl 40 set ref 88* 130* 201 204 error_table_$clnzero 000014 external static fixed bin(35,0) dcl 59 ref 193 error_table_$no_move 000020 external static fixed bin(35,0) dcl 61 ref 108 158 error_table_$no_s_permission 000016 external static fixed bin(35,0) dcl 60 ref 152 167 error_table_$noentry 000010 external static fixed bin(35,0) dcl 57 ref 111 error_table_$segknown 000012 external static fixed bin(35,0) dcl 58 ref 100 105 file constant fixed bin(17,0) initial dcl 54 ref 88 fixed builtin function dcl 73 ref 175 fs_get$path_name 000024 constant entry external dcl 64 ref 136 141 initiate 000030 constant entry external dcl 66 ref 97 102 lbranch 000266 automatic structure level 1 dcl 75 set ref 146 ldirname_from 000246 automatic fixed bin(17,0) dcl 37 set ref 136* ldirname_to 000247 automatic fixed bin(17,0) dcl 38 set ref 141* max_length 000253 automatic fixed bin(19,0) dcl 44 set ref 114* 118* 178* 180 mode 3 000266 automatic bit(5) level 2 packed packed unaligned dcl 75 set ref 162 173 null builtin function dcl 73 ref 149 149 164 164 options 000252 automatic bit(2) packed unaligned dcl 41 set ref 93* 112 112 133* 187 187 ptr_from 000260 automatic pointer dcl 48 set ref 97* 114* 131* 136* 197 199* 205* ptr_to 000262 automatic pointer dcl 49 set ref 102* 132* 141* 178* 189* 197 202* quota$check_file 000040 constant entry external dcl 70 ref 182 seg constant fixed bin(17,0) initial dcl 55 ref 130 201 204 set$max_length_path 000042 constant entry external dcl 71 ref 118 status_$get_max_length_ptr 000026 constant entry external dcl 65 ref 114 178 status_$long 000032 constant entry external dcl 67 ref 149 164 target_len 000250 automatic bit(12) packed unaligned dcl 39 set ref 155* 187 tcode 000255 automatic fixed bin(35,0) dcl 46 set ref 95* 134* 202* 203 205* 207 207 terminate_$noname 000034 constant entry external dcl 68 ref 202 205 truncate$trseg 000036 constant entry external dcl 69 ref 189 199 truncate_sw defined bit(1) packed unaligned dcl 43 ref 187 type 000266 automatic bit(2) level 2 packed packed unaligned dcl 75 set ref 157 171 words 000254 automatic fixed bin(19,0) dcl 45 set ref 176* 180 197 NAMES DECLARED BY EXPLICIT CONTEXT. badmove 000564 constant label dcl 158 ref 162 171 173 179 180 185 common 000505 constant label dcl 146 ref 124 ffile 000033 constant entry external dcl 22 fin0 001034 constant label dcl 207 ref 100 139 144 201 203 204 fin1 001020 constant label dcl 204 ref 109 115 117 122 fin2 001002 constant label dcl 201 ref 152 159 167 190 194 fs_move 000017 constant entry external dcl 14 fseg 000367 constant entry external dcl 126 try2 000176 constant label dcl 102 ref 119 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1244 1310 1043 1254 Length 1504 1043 44 160 201 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME fs_move 234 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME fs_move 000100 created_seg fs_move 000101 dirname_from fs_move 000153 dirname_to fs_move 000225 ename_from fs_move 000235 ename_to fs_move 000245 curlen fs_move 000246 ldirname_from fs_move 000247 ldirname_to fs_move 000250 target_len fs_move 000251 entry_point fs_move 000252 options fs_move 000253 max_length fs_move 000254 words fs_move 000255 tcode fs_move 000256 code fs_move 000260 ptr_from fs_move 000262 ptr_to fs_move 000264 dptr fs_move 000266 lbranch fs_move THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. append$branch fs_get$path_name initiate quota$check_file set$max_length_path status_$get_max_length_ptr status_$long terminate_$noname truncate$trseg THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$clnzero error_table_$no_move error_table_$no_s_permission error_table_$noentry error_table_$segknown LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 14 000016 22 000024 88 000070 89 000072 90 000100 91 000105 92 000112 93 000117 94 000124 95 000125 97 000127 100 000171 102 000176 105 000241 107 000246 108 000250 109 000254 111 000255 112 000257 113 000262 114 000264 115 000276 116 000300 117 000327 118 000331 119 000356 122 000360 124 000361 126 000362 130 000377 131 000401 132 000405 133 000410 134 000415 136 000417 139 000450 141 000452 144 000503 146 000505 149 000507 152 000547 155 000555 157 000560 158 000564 159 000567 162 000570 164 000575 167 000635 171 000643 173 000647 175 000653 176 000656 178 000660 179 000673 180 000675 182 000700 185 000725 187 000727 189 000734 190 000750 191 000752 193 000753 194 000756 197 000757 199 000766 201 001002 202 001005 203 001016 204 001020 205 001023 207 001034 208 001040 210 001042 ----------------------------------------------------------- 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