COMPILATION LISTING OF SEGMENT iod_command Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1659.2 mst Mon 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 /* Constructs a command line for execution by the I/O daemon command processor: This Multics command is intended for use 12* within I/O daemon extended commands (exec_coms) when it is necessary to issue actual I/O daemon commands. For example, 13* 14* iod_command defer_time pica_10 30 15* 16* sets the automatic defer time for the "pica_10" minor device to 30 minutes */ 17 18 /* Note: The "go" command may not be issued using this interface */ 19 20 /* Created: 27 September 1981 by G. Palter */ 21 22 23 iod_command: 24 procedure () options (variable); 25 26 27 dcl argument character (argument_lth) unaligned based (argument_ptr); 28 dcl argument_lth fixed binary (21); 29 dcl argument_ptr pointer; 30 31 dcl system_area area based (system_area_ptr); 32 dcl system_area_ptr pointer; 33 34 dcl local_buffer character (512); 35 36 dcl buffer character (buffer_lth) based (buffer_ptr); 37 dcl buffer_lth fixed binary (21); 38 dcl buffer_ptr pointer; 39 40 dcl command_line character (command_line_lth) based (buffer_ptr); 41 dcl command_line_lth fixed binary (21); 42 43 dcl new_buffer character (new_buffer_lth) based (new_buffer_ptr); 44 dcl new_buffer_lth fixed binary (21); 45 dcl new_buffer_ptr pointer; 46 47 dcl (n_arguments, idx) fixed binary; 48 49 dcl code fixed binary (35); 50 51 dcl IOD_COMMAND character (32) static options (constant) initial ("iod_command"); 52 53 dcl (MASTER initial (1), /* command line from the master console ... */ 54 RECURSIVE_COMMAND_LEVEL initial (2)) /* ... being executed from within another command */ 55 fixed binary static options (constant); 56 57 dcl (com_err_, com_err_$suppress_name) entry () options (variable); 58 dcl cu_$arg_count entry (fixed binary, fixed binary (35)); 59 dcl cu_$arg_ptr entry (fixed binary, pointer, fixed binary (21), fixed binary (35)); 60 dcl get_system_free_area_ entry () returns (pointer); 61 dcl iodd_command_processor_ entry (fixed binary, fixed binary, character (*), fixed binary (35)); 62 63 dcl cleanup condition; 64 65 dcl (addr, length, max, substr) builtin; 66 67 /* */ 68 69 /* iod_command: entry () options (variable); */ 70 71 call cu_$arg_count (n_arguments, code); 72 if code ^= 0 then do; /* not called as a command */ 73 call com_err_ (code, IOD_COMMAND); 74 return; 75 end; 76 77 if n_arguments = 0 then do; 78 call com_err_$suppress_name (0, IOD_COMMAND, "Usage: ^a command_line", IOD_COMMAND); 79 return; 80 end; 81 82 command_line_lth = 0; 83 84 buffer_ptr = addr (local_buffer); 85 buffer_lth = length (local_buffer); 86 87 system_area_ptr = get_system_free_area_ (); 88 89 on condition (cleanup) 90 begin; 91 if buffer_ptr ^= addr (local_buffer) then 92 free buffer in (system_area); 93 end; 94 95 96 /* Construct the command line: for consistency with other commands that take command lines as unquoted arguments, the 97* individual words of the command line are not requoted */ 98 99 do idx = 1 to n_arguments; 100 101 call cu_$arg_ptr (idx, argument_ptr, argument_lth, code); 102 if code ^= 0 then do; 103 call com_err_ (code, IOD_COMMAND, "Fetching argument #^d.", idx); 104 go to RETURN_FROM_IOD_COMMAND; 105 end; 106 107 if (command_line_lth + argument_lth + 1) > buffer_lth 108 then do; /* need to expand the buffer being constructed */ 109 new_buffer_lth = max ((buffer_lth + 512), (command_line_lth + argument_lth + 128)); 110 allocate new_buffer in (system_area) set (new_buffer_ptr); 111 new_buffer = buffer; /* copy what we have so far ... */ 112 if buffer_ptr ^= addr (local_buffer) then /* current buffer was allocated */ 113 free buffer in (system_area); 114 buffer_ptr = new_buffer_ptr; /* switch to new buffer */ 115 buffer_lth = new_buffer_lth; 116 end; 117 118 substr (buffer, (command_line_lth+1), (argument_lth+1)) = argument; 119 120 command_line_lth = command_line_lth + argument_lth + 1; 121 end; 122 123 command_line_lth = command_line_lth - 1; /* added an extra trailing space */ 124 125 126 /* Pass the command on for execution: let the I/O daemon environment handle all errors */ 127 128 call iodd_command_processor_ (MASTER, RECURSIVE_COMMAND_LEVEL, command_line, (0)); 129 130 131 /* Clean up */ 132 133 RETURN_FROM_IOD_COMMAND: 134 if buffer_ptr ^= addr (local_buffer) then 135 free buffer in (system_area); 136 137 return; 138 139 end iod_command; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1507.9 iod_command.pl1 >dumps>old>recomp>iod_command.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. IOD_COMMAND 000001 constant char(32) initial unaligned dcl 51 set ref 73* 78* 78* 103* MASTER 000013 constant fixed bin(17,0) initial dcl 53 set ref 128* RECURSIVE_COMMAND_LEVEL 000000 constant fixed bin(17,0) initial dcl 53 set ref 128* addr builtin function dcl 65 ref 84 91 112 133 argument based char unaligned dcl 27 ref 118 argument_lth 000100 automatic fixed bin(21,0) dcl 28 set ref 101* 107 109 118 118 120 argument_ptr 000102 automatic pointer dcl 29 set ref 101* 118 buffer based char unaligned dcl 36 set ref 91 111 112 118* 133 buffer_lth 000306 automatic fixed bin(21,0) dcl 37 set ref 85* 91 91 107 109 111 112 112 115* 118 133 133 buffer_ptr 000310 automatic pointer dcl 38 set ref 84* 91 91 111 112 112 114* 118 128 133 133 cleanup 000322 stack reference condition dcl 63 ref 89 code 000320 automatic fixed bin(35,0) dcl 49 set ref 71* 72 73* 101* 102 103* com_err_ 000010 constant entry external dcl 57 ref 73 103 com_err_$suppress_name 000012 constant entry external dcl 57 ref 78 command_line based char unaligned dcl 40 set ref 128* command_line_lth 000312 automatic fixed bin(21,0) dcl 41 set ref 82* 107 109 118 120* 120 123* 123 128 128 cu_$arg_count 000014 constant entry external dcl 58 ref 71 cu_$arg_ptr 000016 constant entry external dcl 59 ref 101 get_system_free_area_ 000020 constant entry external dcl 60 ref 87 idx 000317 automatic fixed bin(17,0) dcl 47 set ref 99* 101* 103* iodd_command_processor_ 000022 constant entry external dcl 61 ref 128 length builtin function dcl 65 ref 85 local_buffer 000106 automatic char(512) unaligned dcl 34 set ref 84 85 91 112 133 max builtin function dcl 65 ref 109 n_arguments 000316 automatic fixed bin(17,0) dcl 47 set ref 71* 77 99 new_buffer based char unaligned dcl 43 set ref 110 111* new_buffer_lth 000313 automatic fixed bin(21,0) dcl 44 set ref 109* 110 110 111 115 new_buffer_ptr 000314 automatic pointer dcl 45 set ref 110* 111 114 substr builtin function dcl 65 set ref 118* system_area based area(1024) dcl 31 ref 91 110 112 133 system_area_ptr 000104 automatic pointer dcl 32 set ref 87* 91 110 112 133 NAMES DECLARED BY EXPLICIT CONTEXT. RETURN_FROM_IOD_COMMAND 000411 constant label dcl 133 ref 104 iod_command 000041 constant entry external dcl 23 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 532 556 425 542 Length 732 425 24 137 105 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME iod_command 255 external procedure is an external procedure. on unit on line 89 66 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME iod_command 000100 argument_lth iod_command 000102 argument_ptr iod_command 000104 system_area_ptr iod_command 000106 local_buffer iod_command 000306 buffer_lth iod_command 000310 buffer_ptr iod_command 000312 command_line_lth iod_command 000313 new_buffer_lth iod_command 000314 new_buffer_ptr iod_command 000316 n_arguments iod_command 000317 idx iod_command 000320 code iod_command THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return enable ext_entry int_entry alloc_based free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ com_err_$suppress_name cu_$arg_count cu_$arg_ptr get_system_free_area_ iodd_command_processor_ NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 23 000040 71 000046 72 000056 73 000060 74 000075 77 000076 78 000100 79 000133 82 000134 84 000135 85 000137 87 000141 89 000150 91 000164 93 000200 99 000201 101 000210 102 000225 103 000227 104 000262 107 000263 109 000271 110 000302 111 000311 112 000317 114 000332 115 000334 118 000336 120 000351 121 000355 123 000357 128 000361 133 000411 137 000424 ----------------------------------------------------------- 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