COMPILATION LISTING OF SEGMENT dm_signal_shutdown_warning Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/04/85 0932.4 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* format: ^indcomtxt */ 8 /* DESCRIPTION: 9* 10* This procedure, dm_signal_shutdown_warning, signals the 11* dm_shutdown_warning_ condition in a user process. It is the target of 12* the first alarm call set up by a process that has received the 13* dm_shutdown_scheduled_ IPS, or per-process initialization if the warning 14* time for the DMS has already passed. It builds a condition info 15* structure giving the reason for the DMS shutdown and the planned time; 16* calls signal_ to allow the user to process the condition if desired (with 17* the quiet restart set); and if it gets control back, prints a warning 18* message on the error_output I/O switch warning the user when the DMS will 19* shutdown. In general, we do not expect users to catch the signalled 20* condition, but do it as a convenience. 21* 22* The condition info structure is found in the include file 23* dm_shut_warn_info.incl.pl1 and is named dm_shutdown_warning_info. There 24* is a flag the user may set to suppress the warning message from being 25* printed. 26* 27* If the user process is an absentee, no message is printed. 28**/ 29 30 /* HISTORY: 31* 32*Written by Lee A. Newcomb, 11/10/83. 33*Modified: 34*04/19/84 by Lee A. Newcomb: to upgrade from prototype version. 35*07/16/84 by R. Michael Tague: Changed the call dm_util_$using_dm to 36* call dm_misc_util_$dm_is_process_using_dm. 37*08/17/84 by Lee A. Newcomb: changed dm_per_system_$ calls to go through 38* the dm_misc_util_ TV. 39*09/19/84 by Lee A. Newcomb: Renamed from dm_shut_warn_handler_ and made 40* changes to signal the dm_shutdown_warning_ condition and output 41* the warning message without assuming that txns have been turned 42* off. 43*10/29/84 by Lee A. Newcomb: Fixed to not use dm_ prefix on 44* dm_misc_util_$is_process_using_dm. 45*03/11/85 by Lindsey L. Spratt: y Reformatted the message. Changed to use 46* user_io instead of error_output, ioa_$ioa_switch instead of 47* ioa_$ioa_stream. 48**/ 49 50 /* format: style2,^inddcls,linecom,ifthendo,ifthen,^indnoniterdo,dclind5,idind35 */ 51 52 dm_signal_shutdown_warning: 53 proc (); 54 55 /* START OF DECLARATIONS */ 56 57 /* Automatic */ 58 dcl ( 59 (begin_shutdown_time_string, user_shutdown_time_string) 60 char (6), 61 curr_process_type fixed bin (17), /* for NOT warning absentees */ 62 1 local_dm_shutdown_warning_info aligned like dm_shutdown_warning_info, 63 time_string char (24) /* for getting printable times */ 64 ) automatic; 65 66 /* Based */ 67 /* Builtin */ 68 dcl (addr, length, null, size, substr, unspec) 69 builtin; 70 71 /* Condition */ 72 dcl ioa_error condition; 73 74 /* Constant */ 75 /* Entry */ 76 dcl ( 77 date_time_ entry (fixed bin (71), char (*)), 78 dm_misc_util_$get_shutdown_reason entry returns (char (64)), 79 dm_misc_util_$get_begin_shutdown_time 80 entry returns (fixed bin (71)), 81 dm_misc_util_$get_user_shutdown_time 82 entry returns (fixed bin (71)), 83 dm_misc_util_$is_process_using_dm entry () returns (bit (1) aligned), 84 ioa_$ioa_switch entry () options (variable), 85 signal_ entry () options (variable), 86 user_info_$process_type entry (fixed bin) 87 ); 88 89 /* External */ 90 91 dcl iox_$user_io ptr ext static; 92 93 /* END OF DECLARATIONS */ 94 95 /* Is the process still using DM? If not, warning means nothing. */ 96 97 if dm_misc_util_$is_process_using_dm () then 98 WARN_USER: 99 do; 100 101 /* OK, we must fill in the info structure. */ 102 /* First, the condition info header portion. However, header.info_string */ 103 /* we leave for after we fill in the DM specific info. */ 104 105 unspec (local_dm_shutdown_warning_info) = "0"b; 106 /* null flags and all */ 107 local_dm_shutdown_warning_info.header.length = size (local_dm_shutdown_warning_info); 108 /* nothing like self-definition */ 109 local_dm_shutdown_warning_info.header.version = DM_SHUTDOWN_WARNING_INFO_VERSION_1; 110 local_dm_shutdown_warning_info.header.quiet_restart = "1"b; 111 /* turn quiet_restart on */ 112 113 114 /* now the DM part of the condition info. */ 115 local_dm_shutdown_warning_info.begin_shutdown_time = dm_misc_util_$get_begin_shutdown_time (); 116 local_dm_shutdown_warning_info.user_shutdown_time = dm_misc_util_$get_user_shutdown_time (); 117 local_dm_shutdown_warning_info.reason = dm_misc_util_$get_shutdown_reason (); 118 119 /* Now must build the info_string. This is to save us work later and */ 120 /* the user work if he decides not to return to us. This requires us */ 121 /* to extract the time of the begin and user shutdown steps from the */ 122 /* date_time string after calling date_time_. This should be changed */ 123 /* to use date_time_$format to get the user's per-process time format */ 124 /* when it will not interfere with controlled releases. Care must be */ 125 /* used to make sure the 256 character limit of info_string is not */ 126 /* overflowed. */ 127 128 call date_time_ (local_dm_shutdown_warning_info.begin_shutdown_time, time_string); 129 begin_shutdown_time_string = substr (time_string, 11, 6); 130 call date_time_ (local_dm_shutdown_warning_info.user_shutdown_time, time_string); 131 user_shutdown_time_string = substr (time_string, 11, 6); 132 133 local_dm_shutdown_warning_info.header.info_string = 134 " DM is shutting down; no new transactions will be allowed after " 135 || begin_shutdown_time_string || ". 136 Please use the dm_user_shutdown command, or, at " || user_shutdown_time_string || ", 137 a forced shutdown will be done. Shutdown reason: 138 "; 139 local_dm_shutdown_warning_info.header.info_string = 140 local_dm_shutdown_warning_info.header.info_string 141 || 142 substr (local_dm_shutdown_warning_info.reason, 1, 143 min (length (rtrim (local_dm_shutdown_warning_info.reason)), 144 256 - length (local_dm_shutdown_warning_info.header.info_string))); 145 146 /* NOW signal the shutdown warning to the user with the above info. */ 147 148 call signal_ ("dm_shutdown_warning_", null (), addr (local_dm_shutdown_warning_info), null ()); 149 150 /* To get to this point, the user must have either (1) not handled the */ 151 /* condition we signalled, or (2) handled it, but used continue_to_signal_ */ 152 /* to return control here. In either case, we expect that the user wishes */ 153 /* to see the shutdown warning, unless the dont_print_warning flag in the */ 154 /* condition info structure has been flipped on. However, if the process */ 155 /* is absentee, we do not add to the absout, but just return to preserve */ 156 /* any user formatting. The warning message is output on the error_output */ 157 /* IO switch. */ 158 159 call user_info_$process_type (curr_process_type); 160 if curr_process_type ^= 2 & /* not absentee */ 161 ^local_dm_shutdown_warning_info.flags.dont_print_warning then 162 OUTPUT_WARNING: 163 do; 164 on ioa_error go to WARNING_FAILED; 165 call ioa_$ioa_switch (iox_$user_io, local_dm_shutdown_warning_info.header.info_string); 166 WARNING_FAILED: /* in case error_output is not open or something */ 167 end OUTPUT_WARNING; 168 169 170 end WARN_USER; 171 172 173 MAIN_RETURN: 174 return; 175 176 177 /* end dm_signal_shutdown_warning; */ 178 1 1 /* BEGIN INCLUDE FILE condition_info_header.incl.pl1 BIM 1981 */ 1 2 /* format: style2 */ 1 3 1 4 declare condition_info_header_ptr 1 5 pointer; 1 6 declare 1 condition_info_header 1 7 aligned based (condition_info_header_ptr), 1 8 2 length fixed bin, /* length in words of this structure */ 1 9 2 version fixed bin, /* version number of this structure */ 1 10 2 action_flags aligned, /* tell handler how to proceed */ 1 11 3 cant_restart bit (1) unaligned, /* caller doesn't ever want to be returned to */ 1 12 3 default_restart bit (1) unaligned, /* caller can be returned to with no further action */ 1 13 3 quiet_restart bit (1) unaligned, /* return, and print no message */ 1 14 3 support_signal bit (1) unaligned, /* treat this signal as if the signalling procedure had the support bit set */ 1 15 /* if the signalling procedure had the support bit set, do the same for its caller */ 1 16 3 pad bit (32) unaligned, 1 17 2 info_string char (256) varying, /* may contain printable message */ 1 18 2 status_code fixed bin (35); /* if^=0, code interpretable by com_err_ */ 1 19 1 20 /* END INCLUDE FILE condition_info_header.incl.pl1 */ 179 180 2 1 /* BEGIN INCLUDE FILE dm_shut_warn_info.incl.pl1 */ 2 2 2 3 /* DESCRIPTION: 2 4* 2 5* The following structure is used for keeping track of data 2 6* for the dm_shutdown_warning_ condition. It is filled in by 2 7* dm_misc_util_$shutdown_warning before calling signal_. 2 8**/ 2 9 2 10 /* HISTORY: 2 11* 2 12*Written by Lee A. Newcomb, 09/06/84. 2 13*Modified: 2 14**/ 2 15 2 16 /* format: style2,^inddcls,linecom,ifthendo,ifthen,^indnoniterdo,dclind5,idind35 */ 2 17 2 18 dcl 1 dm_shutdown_warning_info aligned based (dm_shutdown_warning_info_ptr), 2 19 2 header like condition_info_header, 2 20 /* version is one, */ 2 21 /* info_string is set up with warning */ 2 22 2 begin_shutdown_time fixed bin (71), /* time no new txns may begin */ 2 23 2 user_shutdown_time fixed bin (71), /* time to signal dm_user_shutdown_ */ 2 24 2 flags, 2 25 3 dont_print_warning bit (1) unaligned, /* if set by user, we don't print info_string */ 2 26 3 mbz bit (35) unaligned, /* must be zero */ 2 27 2 reason char (64); /* why the DMS is shutting down */ 2 28 2 29 dcl dm_shutdown_warning_info_ptr ptr; 2 30 2 31 dcl DM_SHUTDOWN_WARNING_INFO_VERSION_1 fixed bin init (1) int static options (constant); 2 32 2 33 2 34 /* END INCLUDE FILE dm_shut_warn_info.incl.pl1 */ 181 182 183 184 end dm_signal_shutdown_warning; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/04/85 0824.6 dm_signal_shutdown_warning.pl1 >spec>on>7192.pbf-04/04/85>dm_signal_shutdown_warning.pl1 179 1 03/24/82 1347.2 condition_info_header.incl.pl1 >ldd>include>condition_info_header.incl.pl1 181 2 01/07/85 0859.7 dm_shut_warn_info.incl.pl1 >ldd>include>dm_shut_warn_info.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. DM_SHUTDOWN_WARNING_INFO_VERSION_1 constant fixed bin(17,0) initial dcl 2-31 ref 109 action_flags 2 000106 automatic structure level 3 dcl 58 addr builtin function dcl 68 ref 148 148 begin_shutdown_time 106 000106 automatic fixed bin(71,0) level 2 dcl 58 set ref 115* 128* begin_shutdown_time_string 000100 automatic char(6) unaligned dcl 58 set ref 129* 133 condition_info_header based structure level 1 dcl 1-6 curr_process_type 000104 automatic fixed bin(17,0) dcl 58 set ref 159* 160 date_time_ 000010 constant entry external dcl 76 ref 128 130 dm_misc_util_$get_begin_shutdown_time 000014 constant entry external dcl 76 ref 115 dm_misc_util_$get_shutdown_reason 000012 constant entry external dcl 76 ref 117 dm_misc_util_$get_user_shutdown_time 000016 constant entry external dcl 76 ref 116 dm_misc_util_$is_process_using_dm 000020 constant entry external dcl 76 ref 97 dm_shutdown_warning_info based structure level 1 dcl 2-18 dont_print_warning 112 000106 automatic bit(1) level 3 packed unaligned dcl 58 set ref 160 flags 112 000106 automatic structure level 2 dcl 58 header 000106 automatic structure level 2 dcl 58 info_string 3 000106 automatic varying char(256) level 3 dcl 58 set ref 133* 139* 139 139 165* ioa_$ioa_switch 000022 constant entry external dcl 76 ref 165 ioa_error 000250 stack reference condition dcl 72 ref 164 iox_$user_io 000030 external static pointer dcl 91 set ref 165* length builtin function dcl 68 in procedure "dm_signal_shutdown_warning" ref 139 139 length 000106 automatic fixed bin(17,0) level 3 in structure "local_dm_shutdown_warning_info" dcl 58 in procedure "dm_signal_shutdown_warning" set ref 107* local_dm_shutdown_warning_info 000106 automatic structure level 1 dcl 58 set ref 105* 107 148 148 null builtin function dcl 68 ref 148 148 148 148 quiet_restart 2(02) 000106 automatic bit(1) level 4 packed unaligned dcl 58 set ref 110* reason 113 000106 automatic char(64) level 2 dcl 58 set ref 117* 139 139 signal_ 000024 constant entry external dcl 76 ref 148 size builtin function dcl 68 ref 107 substr builtin function dcl 68 ref 129 131 139 time_string 000241 automatic char(24) unaligned dcl 58 set ref 128* 129 130* 131 unspec builtin function dcl 68 set ref 105* user_info_$process_type 000026 constant entry external dcl 76 ref 159 user_shutdown_time 110 000106 automatic fixed bin(71,0) level 2 dcl 58 set ref 116* 130* user_shutdown_time_string 000102 automatic char(6) unaligned dcl 58 set ref 131* 133 version 1 000106 automatic fixed bin(17,0) level 3 dcl 58 set ref 109* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. condition_info_header_ptr automatic pointer dcl 1-4 dm_shutdown_warning_info_ptr automatic pointer dcl 2-29 NAMES DECLARED BY EXPLICIT CONTEXT. MAIN_RETURN 000416 constant label dcl 173 OUTPUT_WARNING 000362 constant label dcl 160 WARNING_FAILED 000416 constant label dcl 166 ref 164 WARN_USER 000120 constant label dcl 97 dm_signal_shutdown_warning 000102 constant entry external dcl 52 NAMES DECLARED BY CONTEXT OR IMPLICATION. min builtin function ref 139 rtrim builtin function ref 139 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 570 622 417 600 Length 1050 417 32 212 150 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME dm_signal_shutdown_warning 220 external procedure is an external procedure. on unit on line 164 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME dm_signal_shutdown_warning 000100 begin_shutdown_time_string dm_signal_shutdown_warning 000102 user_shutdown_time_string dm_signal_shutdown_warning 000104 curr_process_type dm_signal_shutdown_warning 000106 local_dm_shutdown_warning_info dm_signal_shutdown_warning 000241 time_string dm_signal_shutdown_warning THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return tra_ext enable shorten_stack ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. date_time_ dm_misc_util_$get_begin_shutdown_time dm_misc_util_$get_shutdown_reason dm_misc_util_$get_user_shutdown_time dm_misc_util_$is_process_using_dm ioa_$ioa_switch signal_ user_info_$process_type THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. iox_$user_io LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 52 000101 97 000107 105 000120 107 000123 109 000125 110 000127 115 000131 116 000140 117 000147 128 000161 129 000176 130 000202 131 000217 133 000223 139 000257 148 000312 159 000345 160 000354 164 000362 165 000401 173 000416 ----------------------------------------------------------- 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