Merge lp:~jeff-apple/openvista-gtm-integration/bug327480 into lp:openvista-gtm-integration
- bug327480
- Merge into mainline
Proposed by
jeff.apple
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~jeff-apple/openvista-gtm-integration/bug327480 | ||||
Merge into: | lp:openvista-gtm-integration | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~jeff-apple/openvista-gtm-integration/bug327480 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jon Tai | Disapprove | ||
Review via email: mp+5269@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
jeff.apple (jeff-apple) wrote : | # |
Revision history for this message
Jon Tai (jontai) wrote : | # |
Jeff, your new approach seems to work, but instead of merging directly with mainline, I'd like to merge it with my gtm-packaging branch, then merge that branch into mainline. My branch has the infrastructure necessary to build GT.M RPMs that include your work.
I've already merged your branch into my gtm-packaging branch and re-created the diff for the RPMs and tested lightly. Everything seems to jive - great work! I'm going to Disapprove this merge request and put up one of my own in a few minutes.
review:
Disapprove
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'src' | |||
2 | === added directory 'src/gtm' | |||
3 | === added directory 'src/gtm/sr_port' | |||
4 | === added file 'src/gtm/sr_port/gbldefs.c' | |||
5 | --- src/gtm/sr_port/gbldefs.c 1970-01-01 00:00:00 +0000 | |||
6 | +++ src/gtm/sr_port/gbldefs.c 2009-04-07 01:13:36 +0000 | |||
7 | @@ -0,0 +1,1012 @@ | |||
8 | 1 | /**************************************************************** | ||
9 | 2 | * * | ||
10 | 3 | * Copyright 2001, 2008 Fidelity Information Services, Inc * | ||
11 | 4 | * * | ||
12 | 5 | * This source code contains the intellectual property * | ||
13 | 6 | * of its copyright holder(s), and is made available * | ||
14 | 7 | * under a license. If you do not know the terms of * | ||
15 | 8 | * the license, please stop and do not read further. * | ||
16 | 9 | * * | ||
17 | 10 | ****************************************************************/ | ||
18 | 11 | |||
19 | 12 | /* General repository for global variable definitions. This keeps us from | ||
20 | 13 | pulling in modules and all their references when all we wanted was the | ||
21 | 14 | global data def.. */ | ||
22 | 15 | |||
23 | 16 | #include "mdef.h" | ||
24 | 17 | |||
25 | 18 | #include "gtm_inet.h" | ||
26 | 19 | #include "gtm_iconv.h" | ||
27 | 20 | #include "gtm_socket.h" | ||
28 | 21 | #include "gtm_unistd.h" | ||
29 | 22 | #include "gtm_limits.h" | ||
30 | 23 | |||
31 | 24 | #include <signal.h> | ||
32 | 25 | #ifdef __MVS__ | ||
33 | 26 | #include "gtm_time.h" /* required for fd_set */ | ||
34 | 27 | #endif | ||
35 | 28 | #include <sys/time.h> | ||
36 | 29 | #ifdef UNIX | ||
37 | 30 | # include <sys/un.h> | ||
38 | 31 | #endif | ||
39 | 32 | #ifdef VMS | ||
40 | 33 | # include <descrip.h> /* Required for gtmsource.h */ | ||
41 | 34 | # include <ssdef.h> | ||
42 | 35 | # include <fab.h> | ||
43 | 36 | # include "desblk.h" | ||
44 | 37 | #endif | ||
45 | 38 | #include "cache.h" | ||
46 | 39 | #include "hashtab_int4.h" | ||
47 | 40 | #include "hashtab_int8.h" | ||
48 | 41 | #include "hashtab_mname.h" | ||
49 | 42 | #include "hashtab_objcode.h" | ||
50 | 43 | #include "rtnhdr.h" | ||
51 | 44 | #include "gdsroot.h" | ||
52 | 45 | #include "gdskill.h" | ||
53 | 46 | #include "ccp.h" | ||
54 | 47 | #include "gtm_facility.h" | ||
55 | 48 | #include "fileinfo.h" | ||
56 | 49 | #include "gdsbt.h" | ||
57 | 50 | #include "gdsfhead.h" | ||
58 | 51 | #include "filestruct.h" | ||
59 | 52 | #include "gdscc.h" | ||
60 | 53 | #include "comline.h" | ||
61 | 54 | #include "compiler.h" | ||
62 | 55 | #include "cmd_qlf.h" | ||
63 | 56 | #include "io.h" | ||
64 | 57 | #include "iosp.h" | ||
65 | 58 | #include "jnl.h" | ||
66 | 59 | #include "lv_val.h" | ||
67 | 60 | #include "sbs_blk.h" | ||
68 | 61 | #include "mdq.h" | ||
69 | 62 | #include "mprof.h" | ||
70 | 63 | #include "mv_stent.h" | ||
71 | 64 | #include "stack_frame.h" | ||
72 | 65 | #include "stp_parms.h" | ||
73 | 66 | #include "stringpool.h" | ||
74 | 67 | #include "buddy_list.h" /* needed for tp.h */ | ||
75 | 68 | #include "tp.h" | ||
76 | 69 | #include "tp_frame.h" | ||
77 | 70 | #include "mlkdef.h" | ||
78 | 71 | #include "zshow.h" | ||
79 | 72 | #include "zwrite.h" | ||
80 | 73 | #include "zbreak.h" | ||
81 | 74 | #include "fnpc.h" | ||
82 | 75 | #include "mmseg.h" | ||
83 | 76 | #ifndef VMS | ||
84 | 77 | # include "gtmsiginfo.h" | ||
85 | 78 | #endif | ||
86 | 79 | #include "gtmimagename.h" | ||
87 | 80 | #include "iotcpdef.h" | ||
88 | 81 | #include "gt_timer.h" | ||
89 | 82 | #include "iosocketdef.h" /* needed for socket_pool and MAX_N_SOCKETS*/ | ||
90 | 83 | #include "ctrlc_handler_dummy.h" | ||
91 | 84 | #include "unw_prof_frame_dummy.h" | ||
92 | 85 | #include "op.h" | ||
93 | 86 | #include "gtmsecshr.h" | ||
94 | 87 | #include "error_trap.h" | ||
95 | 88 | #include "patcode.h" /* for pat_everything and sizeof_pat_everything */ | ||
96 | 89 | #include "source_file.h" /* for REV_TIME_BUFF_LEN */ | ||
97 | 90 | #include "mupipbckup.h" | ||
98 | 91 | #include "dpgbldir.h" | ||
99 | 92 | #include "mmemory.h" | ||
100 | 93 | #include "have_crit.h" | ||
101 | 94 | |||
102 | 95 | /* FOR REPLICATION RELATED GLOBALS */ | ||
103 | 96 | #include "repl_msg.h" | ||
104 | 97 | #include "gtmsource.h" | ||
105 | 98 | #include "gtmrecv.h" | ||
106 | 99 | |||
107 | 100 | /* FOR MERGE RELATED GLOBALS */ | ||
108 | 101 | #include "subscript.h" | ||
109 | 102 | #include "lvname_info.h" | ||
110 | 103 | #include "gvname_info.h" | ||
111 | 104 | #include "op_merge.h" | ||
112 | 105 | |||
113 | 106 | #ifdef UNIX | ||
114 | 107 | /* The define of CHEXPAND below causes error.h to create GBLDEFs */ | ||
115 | 108 | #define CHEXPAND | ||
116 | 109 | #include "error.h" | ||
117 | 110 | |||
118 | 111 | #include "cli.h" | ||
119 | 112 | #include "invocation_mode.h" | ||
120 | 113 | #include "fgncal.h" | ||
121 | 114 | #include "parse_file.h" /* for MAX_FBUFF */ | ||
122 | 115 | #include "repl_sem.h" | ||
123 | 116 | #include "gtm_zlib.h" | ||
124 | 117 | #endif | ||
125 | 118 | |||
126 | 119 | #include "jnl_typedef.h" | ||
127 | 120 | |||
128 | 121 | #ifdef VMS | ||
129 | 122 | #include "gtm_logicals.h" /* for GTM_MEMORY_NOACCESS_COUNT */ | ||
130 | 123 | #endif | ||
131 | 124 | |||
132 | 125 | #include "gds_blk_upgrade.h" /* for UPGRADE_IF_NEEDED flag */ | ||
133 | 126 | #include "cws_insert.h" /* for CWS_REORG_ARRAYSIZE */ | ||
134 | 127 | |||
135 | 128 | #ifdef UNICODE_SUPPORTED | ||
136 | 129 | #include "gtm_icu_api.h" | ||
137 | 130 | #include "gtm_utf8.h" | ||
138 | 131 | #endif | ||
139 | 132 | |||
140 | 133 | #define DEFAULT_ZERROR_STR "Unprocessed $ZERROR, see $ZSTATUS" | ||
141 | 134 | #define DEFAULT_ZERROR_LEN (sizeof(DEFAULT_ZERROR_STR) - 1) | ||
142 | 135 | |||
143 | 136 | GBLDEF gd_region *db_init_region; | ||
144 | 137 | GBLDEF sgmnt_data_ptr_t cs_data; | ||
145 | 138 | GBLDEF sgmnt_addrs *cs_addrs; | ||
146 | 139 | |||
147 | 140 | GBLDEF unsigned short proc_act_type; | ||
148 | 141 | GBLDEF volatile bool ctrlc_pending; | ||
149 | 142 | GBLDEF volatile int4 ctrap_action_is; | ||
150 | 143 | GBLDEF bool out_of_time; | ||
151 | 144 | GBLDEF io_pair io_curr_device; /* current device */ | ||
152 | 145 | GBLDEF io_pair io_std_device; /* standard device */ | ||
153 | 146 | GBLDEF io_log_name *dollar_principal; /* pointer to log name GTM$PRINCIPAL if defined */ | ||
154 | 147 | GBLDEF bool prin_in_dev_failure = FALSE; | ||
155 | 148 | GBLDEF bool prin_out_dev_failure = FALSE; | ||
156 | 149 | GBLDEF io_desc *active_device; | ||
157 | 150 | |||
158 | 151 | GBLDEF bool error_mupip = FALSE, | ||
159 | 152 | compile_time = FALSE, | ||
160 | 153 | file_backed_up = FALSE, | ||
161 | 154 | gv_replopen_error = FALSE, | ||
162 | 155 | gv_replication_error = FALSE, | ||
163 | 156 | incremental = FALSE, | ||
164 | 157 | jobpid = FALSE, | ||
165 | 158 | online = FALSE, | ||
166 | 159 | record = FALSE, | ||
167 | 160 | is_standalone = FALSE, | ||
168 | 161 | std_dev_outbnd = FALSE, | ||
169 | 162 | in_mupip_freeze = FALSE, | ||
170 | 163 | in_backup = FALSE, | ||
171 | 164 | view_debug1 = FALSE, | ||
172 | 165 | view_debug2 = FALSE, | ||
173 | 166 | view_debug3 = FALSE, | ||
174 | 167 | view_debug4 = FALSE, | ||
175 | 168 | dec_nofac; | ||
176 | 169 | |||
177 | 170 | GBLDEF boolean_t is_updproc = FALSE, | ||
178 | 171 | is_updhelper = FALSE, | ||
179 | 172 | mupip_jnl_recover = FALSE, | ||
180 | 173 | repl_allowed = FALSE, | ||
181 | 174 | run_time = FALSE, | ||
182 | 175 | unhandled_stale_timer_pop = FALSE, | ||
183 | 176 | gtcm_connection = FALSE, | ||
184 | 177 | is_replicator = FALSE, /* TRUE => this process can write jnl records to the jnlpool for replicated db */ | ||
185 | 178 | tp_in_use = FALSE, /* TRUE => TP has been used by this process and is thus initialized */ | ||
186 | 179 | dollar_truth = TRUE; | ||
187 | 180 | |||
188 | 181 | GBLDEF VSIG_ATOMIC_T forced_exit = FALSE; /* Asynchronous signal/interrupt handler sets this variable to TRUE, | ||
189 | 182 | * hence the VSIG_ATOMIC_T type in the definition. | ||
190 | 183 | */ | ||
191 | 184 | GBLDEF intrpt_state_t intrpt_ok_state = INTRPT_OK_TO_INTERRUPT; /* any other value implies it is not ok to interrupt */ | ||
192 | 185 | |||
193 | 186 | GBLDEF unsigned char *msp, | ||
194 | 187 | *mubbuf, | ||
195 | 188 | *restart_ctxt, | ||
196 | 189 | *stackbase, | ||
197 | 190 | *stacktop, | ||
198 | 191 | *stackwarn, | ||
199 | 192 | *restart_pc; | ||
200 | 193 | GBLDEF int4 backup_close_errno, | ||
201 | 194 | backup_write_errno, | ||
202 | 195 | mubmaxblk, | ||
203 | 196 | forced_exit_err, | ||
204 | 197 | exit_state, | ||
205 | 198 | restore_read_errno; | ||
206 | 199 | GBLDEF volatile int4 outofband, crit_count = 0; | ||
207 | 200 | GBLDEF int mumps_status = SS_NORMAL, | ||
208 | 201 | stp_array_size = 0; | ||
209 | 202 | GBLDEF gvzwrite_struct gvzwrite_block; | ||
210 | 203 | GBLDEF io_log_name *io_root_log_name; | ||
211 | 204 | GBLDEF lvzwrite_struct lvzwrite_block; | ||
212 | 205 | GBLDEF mliteral literal_chain; | ||
213 | 206 | GBLDEF mstr *comline_base, | ||
214 | 207 | dollar_zsource, | ||
215 | 208 | *err_act, | ||
216 | 209 | **stp_array, | ||
217 | 210 | extnam_str, | ||
218 | 211 | env_gtm_env_xlate; | ||
219 | 212 | GBLDEF MSTR_CONST(default_sysid, "gtm_sysid"); | ||
220 | 213 | GBLDEF int (*gtm_env_xlate_entry)() = NULL; | ||
221 | 214 | GBLDEF void (*gtm_sigusr1_handler)() = NULL; | ||
222 | 215 | GBLDEF mval dollar_zgbldir, | ||
223 | 216 | dollar_zstatus, | ||
224 | 217 | dollar_zstep = DEFINE_MVAL_LITERAL(MV_STR | MV_NM | MV_INT | MV_NUM_APPROX, 0, 0, 1, "B", 0, 0), | ||
225 | 218 | dollar_ztrap, | ||
226 | 219 | ztrap_pop2level = DEFINE_MVAL_LITERAL(MV_NM | MV_INT, 0, 0, 0, 0, 0, 0), | ||
227 | 220 | zstep_action, | ||
228 | 221 | dollar_system, | ||
229 | 222 | dollar_estack_delta = DEFINE_MVAL_LITERAL(MV_STR, 0, 0, 0, NULL, 0, 0), | ||
230 | 223 | dollar_etrap, | ||
231 | 224 | dollar_zerror = DEFINE_MVAL_LITERAL(MV_STR, 0, 0, DEFAULT_ZERROR_LEN, DEFAULT_ZERROR_STR, 0, 0), | ||
232 | 225 | dollar_zyerror, | ||
233 | 226 | dollar_ztexit = DEFINE_MVAL_LITERAL(MV_STR, 0, 0, 0, NULL, 0, 0); | ||
234 | 227 | GBLDEF uint4 dollar_zjob; | ||
235 | 228 | GBLDEF mval dollar_zinterrupt; | ||
236 | 229 | GBLDEF boolean_t dollar_zininterrupt; | ||
237 | 230 | GBLDEF boolean_t dollar_ztexit_bool; /* Truth value of dollar_ztexit when coerced to boolean */ | ||
238 | 231 | GBLDEF boolean_t dollar_zquit_anyway; | ||
239 | 232 | |||
240 | 233 | #define DEFAULT_PROMPT "GTM>" | ||
241 | 234 | /* The prompt buffer size (31) below would allow at least 8 Unicode characters, but since most | ||
242 | 235 | * commonly used Unicode characters only occupy upto 3 bytes, the buffer would at least accommodate | ||
243 | 236 | * 10 Unicode characters in a prompt */ | ||
244 | 237 | GBLDEF char prombuf[MAX_MIDENT_LEN] = DEFAULT_PROMPT; | ||
245 | 238 | GBLDEF MSTR_DEF(gtmprompt, STR_LIT_LEN(DEFAULT_PROMPT), &prombuf[0]); | ||
246 | 239 | |||
247 | 240 | GBLDEF mv_stent *mv_chain; | ||
248 | 241 | GBLDEF sgm_info *first_sgm_info; /* List of participating regions in the TP transaction with NO ftok ordering */ | ||
249 | 242 | GBLDEF sgm_info *first_tp_si_by_ftok; /* List of participating regions in the TP transaction sorted on ftok order */ | ||
250 | 243 | GBLDEF spdesc indr_stringpool, | ||
251 | 244 | rts_stringpool, | ||
252 | 245 | stringpool; | ||
253 | 246 | GBLDEF stack_frame *frame_pointer; | ||
254 | 247 | GBLDEF stack_frame *zyerr_frame = NULL; | ||
255 | 248 | GBLDEF symval *curr_symval; | ||
256 | 249 | GBLDEF tp_frame *tp_pointer; | ||
257 | 250 | GBLDEF tp_region *halt_ptr, | ||
258 | 251 | *grlist; | ||
259 | 252 | GBLDEF trans_num local_tn; /* transaction number for THIS PROCESS (starts at 0 each time) */ | ||
260 | 253 | GBLDEF gv_namehead *gv_target; | ||
261 | 254 | GBLDEF gv_namehead *gv_target_list; | ||
262 | 255 | GBLDEF gvt_container *gvt_pending_list; /* list of gvts that need to be re-examined/re-allocated when region is opened */ | ||
263 | 256 | GBLDEF buddy_list *gvt_pending_buddy_list;/* buddy_list for maintaining memory for gv_targets to be re-examined/allocated */ | ||
264 | 257 | |||
265 | 258 | GBLDEF int4 exi_condition; | ||
266 | 259 | GBLDEF uint4 gtmDebugLevel; | ||
267 | 260 | GBLDEF caddr_t smCallerId; /* Caller of top level malloc/free */ | ||
268 | 261 | GBLDEF int process_exiting; | ||
269 | 262 | GBLDEF int4 dollar_zsystem; | ||
270 | 263 | GBLDEF int4 dollar_zeditor; | ||
271 | 264 | GBLDEF boolean_t sem_incremented = FALSE; | ||
272 | 265 | GBLDEF boolean_t new_dbinit_ipc = FALSE; | ||
273 | 266 | GBLDEF mval **ind_result_array, **ind_result_sp, **ind_result_top; | ||
274 | 267 | GBLDEF mval **ind_source_array, **ind_source_sp, **ind_source_top; | ||
275 | 268 | GBLDEF rtn_tabent *rtn_fst_table, *rtn_names, *rtn_names_top, *rtn_names_end; | ||
276 | 269 | GBLDEF int4 break_message_mask; | ||
277 | 270 | GBLDEF bool rc_locked = FALSE; | ||
278 | 271 | GBLDEF boolean_t certify_all_blocks = FALSE; /* If flag is set all blocks are checked after they are | ||
279 | 272 | * written to the database. Upon error we stay critical | ||
280 | 273 | * and report. This flag can be set via the MUMPS command | ||
281 | 274 | * VIEW "GDSCERT":1. */ | ||
282 | 275 | GBLDEF mval curr_gbl_root; | ||
283 | 276 | GBLDEF gd_addr *original_header; | ||
284 | 277 | GBLDEF hash_table_mname *gd_tab_ptr = NULL; | ||
285 | 278 | GBLDEF mem_list *mem_list_head; | ||
286 | 279 | GBLDEF boolean_t debug_mupip; | ||
287 | 280 | GBLDEF unsigned char t_fail_hist[CDB_MAX_TRIES]; | ||
288 | 281 | GBLDEF cache_rec_ptr_t cr_array[((MAX_BT_DEPTH * 2) - 1) * 2]; /* Maximum number of blocks that can be in transaction */ | ||
289 | 282 | GBLDEF unsigned int cr_array_index; | ||
290 | 283 | GBLDEF boolean_t need_core; /* Core file should be created */ | ||
291 | 284 | GBLDEF boolean_t created_core; /* core file was created */ | ||
292 | 285 | GBLDEF boolean_t core_in_progress; /* creating core NOW */ | ||
293 | 286 | GBLDEF boolean_t dont_want_core; /* Higher level flag overrides need_core set by lower level rtns */ | ||
294 | 287 | GBLDEF boolean_t exit_handler_active; /* recursion prevention */ | ||
295 | 288 | GBLDEF boolean_t block_saved; | ||
296 | 289 | #if defined(KEEP_zOS_EBCDIC) || defined(VMS) | ||
297 | 290 | GBLDEF iconv_t dse_over_cvtcd = (iconv_t)0; | ||
298 | 291 | #endif | ||
299 | 292 | GBLDEF gtm_chset_t dse_over_chset = CHSET_M; | ||
300 | 293 | GBLDEF short int last_source_column; | ||
301 | 294 | GBLDEF char window_token; | ||
302 | 295 | GBLDEF mval window_mval; | ||
303 | 296 | GBLDEF char director_token; | ||
304 | 297 | GBLDEF mval director_mval; | ||
305 | 298 | LITDEF MIDENT_DEF(zero_ident, 0, NULL); /* the null mident */ | ||
306 | 299 | static char ident_buff1[sizeof(mident_fixed)]; | ||
307 | 300 | static char ident_buff2[sizeof(mident_fixed)]; | ||
308 | 301 | GBLDEF MIDENT_DEF(window_ident, 0, &ident_buff1[0]); /* the current identifier */ | ||
309 | 302 | GBLDEF MIDENT_DEF(director_ident, 0, &ident_buff2[0]); /* the look-ahead identifier */ | ||
310 | 303 | GBLDEF char *lexical_ptr; | ||
311 | 304 | GBLDEF int4 aligned_source_buffer[MAX_SRCLINE / sizeof(int4) + 1]; | ||
312 | 305 | GBLDEF unsigned char *source_buffer = (unsigned char *)aligned_source_buffer; | ||
313 | 306 | GBLDEF int4 source_error_found; | ||
314 | 307 | GBLDEF src_line_struct src_head; | ||
315 | 308 | GBLDEF bool code_generated; | ||
316 | 309 | GBLDEF short int source_column, source_line; | ||
317 | 310 | GBLDEF bool devctlexp; | ||
318 | 311 | GBLDEF char cg_phase; /* code generation phase */ | ||
319 | 312 | /* Previous code generation phase: Only used by emit_code.c to initialize the push list at the | ||
320 | 313 | * beginning of each phase (bug fix: C9D12-002478) */ | ||
321 | 314 | GBLDEF char cg_phase_last; | ||
322 | 315 | |||
323 | 316 | GBLDEF int cmd_cnt; | ||
324 | 317 | |||
325 | 318 | GBLDEF command_qualifier glb_cmd_qlf = { CQ_DEFAULT }, | ||
326 | 319 | cmd_qlf = { CQ_DEFAULT }; | ||
327 | 320 | #ifdef __osf__ | ||
328 | 321 | #pragma pointer_size (save) | ||
329 | 322 | #pragma pointer_size (long) | ||
330 | 323 | #endif | ||
331 | 324 | GBLDEF char **cmd_arg; | ||
332 | 325 | #ifdef __osf__ | ||
333 | 326 | #pragma pointer_size (restore) | ||
334 | 327 | #endif | ||
335 | 328 | |||
336 | 329 | #ifndef __vax | ||
337 | 330 | GBLDEF fnpc_area fnpca; /* $piece cache structure area */ | ||
338 | 331 | #endif | ||
339 | 332 | |||
340 | 333 | #ifdef UNIX | ||
341 | 334 | GBLDEF volatile uint4 heartbeat_counter = 0; | ||
342 | 335 | #endif | ||
343 | 336 | |||
344 | 337 | /* DEFERRED EVENTS */ | ||
345 | 338 | GBLDEF int dollar_zmaxtptime = 0; | ||
346 | 339 | GBLDEF bool licensed = TRUE; | ||
347 | 340 | |||
348 | 341 | #if defined(UNIX) | ||
349 | 342 | GBLDEF volatile int4 num_deferred; | ||
350 | 343 | #elif defined(VMS) | ||
351 | 344 | GBLDEF volatile short num_deferred; | ||
352 | 345 | GBLDEF int4 lkid, lid; | ||
353 | 346 | GBLDEF desblk exi_blk; | ||
354 | 347 | GBLDEF struct chf$signal_array *tp_restart_fail_sig; | ||
355 | 348 | GBLDEF boolean_t tp_restart_fail_sig_used; | ||
356 | 349 | #else | ||
357 | 350 | # error "Unsupported Platform" | ||
358 | 351 | #endif | ||
359 | 352 | |||
360 | 353 | GBLDEF volatile int4 fast_lock_count = 0; /* Used in wcs_stale */ | ||
361 | 354 | |||
362 | 355 | /* REPLICATION RELATED GLOBALS */ | ||
363 | 356 | GBLDEF gtmsource_options_t gtmsource_options; | ||
364 | 357 | GBLDEF gtmrecv_options_t gtmrecv_options; | ||
365 | 358 | |||
366 | 359 | GBLDEF unsigned char *profstack_base, *profstack_top, *prof_msp, *profstack_warn; | ||
367 | 360 | GBLDEF unsigned char *prof_stackptr; | ||
368 | 361 | GBLDEF boolean_t is_tracing_on; | ||
369 | 362 | GBLDEF stack_frame_prof *prof_fp; | ||
370 | 363 | GBLDEF void (*tp_timeout_start_timer_ptr)(int4 tmout_sec) = tp_start_timer_dummy; | ||
371 | 364 | GBLDEF void (*tp_timeout_clear_ptr)(void) = tp_clear_timeout_dummy; | ||
372 | 365 | GBLDEF void (*tp_timeout_action_ptr)(void) = tp_timeout_action_dummy; | ||
373 | 366 | GBLDEF void (*ctrlc_handler_ptr)() = ctrlc_handler_dummy; | ||
374 | 367 | GBLDEF int (*op_open_ptr)(mval *v, mval *p, int t, mval *mspace) = op_open_dummy; | ||
375 | 368 | GBLDEF void (*unw_prof_frame_ptr)(void) = unw_prof_frame_dummy; | ||
376 | 369 | GBLDEF boolean_t mu_reorg_process = FALSE; /* set to TRUE by MUPIP REORG */ | ||
377 | 370 | GBLDEF boolean_t mu_reorg_in_swap_blk = FALSE; /* set to TRUE for the duration of the call to "mu_swap_blk" */ | ||
378 | 371 | GBLDEF boolean_t mu_rndwn_process = FALSE; | ||
379 | 372 | GBLDEF gv_key *gv_currkey_next_reorg; | ||
380 | 373 | GBLDEF gv_namehead *reorg_gv_target; | ||
381 | 374 | |||
382 | 375 | #ifdef UNIX | ||
383 | 376 | GBLDEF struct sockaddr_un gtmsecshr_sock_name; | ||
384 | 377 | GBLDEF struct sockaddr_un gtmsecshr_cli_sock_name; | ||
385 | 378 | GBLDEF key_t gtmsecshr_key; | ||
386 | 379 | #endif | ||
387 | 380 | GBLDEF int gtmsecshr_sockpath_len; | ||
388 | 381 | GBLDEF int gtmsecshr_cli_sockpath_len; | ||
389 | 382 | GBLDEF mstr gtmsecshr_pathname; | ||
390 | 383 | GBLDEF int server_start_tries; | ||
391 | 384 | GBLDEF int gtmsecshr_log_file; | ||
392 | 385 | GBLDEF int gtmsecshr_sockfd = -1; | ||
393 | 386 | GBLDEF boolean_t gtmsecshr_sock_init_done = FALSE; | ||
394 | 387 | GBLDEF char muext_code[MUEXT_MAX_TYPES][2] = | ||
395 | 388 | { {'0', '0'}, | ||
396 | 389 | {'0', '1'}, | ||
397 | 390 | {'0', '2'}, | ||
398 | 391 | {'0', '3'}, | ||
399 | 392 | {'0', '4'}, | ||
400 | 393 | {'0', '5'}, | ||
401 | 394 | {'0', '6'}, | ||
402 | 395 | {'0', '7'}, | ||
403 | 396 | {'0', '8'}, | ||
404 | 397 | {'0', '9'}, | ||
405 | 398 | {'1', '0'} | ||
406 | 399 | }; | ||
407 | 400 | GBLDEF int patch_is_fdmp; | ||
408 | 401 | GBLDEF int patch_fdmp_recs; | ||
409 | 402 | GBLDEF boolean_t horiz_growth = FALSE; | ||
410 | 403 | GBLDEF int4 prev_first_off, prev_next_off; | ||
411 | 404 | /* these two globals store the values of first_off and next_off in cse, | ||
412 | 405 | * when there is a blk split at index level. This is to permit rollback | ||
413 | 406 | * to intermediate states */ | ||
414 | 407 | GBLDEF sm_uc_ptr_t min_mmseg; | ||
415 | 408 | GBLDEF sm_uc_ptr_t max_mmseg; | ||
416 | 409 | GBLDEF mmseg *mmseg_head; | ||
417 | 410 | GBLDEF ua_list *first_ua, *curr_ua; | ||
418 | 411 | GBLDEF char *update_array, *update_array_ptr; | ||
419 | 412 | GBLDEF int gv_fillfactor = 100, | ||
420 | 413 | rc_set_fragment; /* Contains offset within data at which data fragment starts */ | ||
421 | 414 | GBLDEF uint4 update_array_size = 0, | ||
422 | 415 | cumul_update_array_size = 0; /* the current total size of the update array */ | ||
423 | 416 | GBLDEF kill_set *kill_set_tail; | ||
424 | 417 | GBLDEF boolean_t pool_init = FALSE; | ||
425 | 418 | GBLDEF boolean_t is_src_server = FALSE; | ||
426 | 419 | GBLDEF boolean_t is_rcvr_server = FALSE; | ||
427 | 420 | GBLDEF jnl_format_buffer *non_tp_jfb_ptr = NULL; | ||
428 | 421 | GBLDEF unsigned char *non_tp_jfb_buff_ptr; | ||
429 | 422 | GBLDEF boolean_t dse_running = FALSE; | ||
430 | 423 | GBLDEF jnlpool_addrs jnlpool; | ||
431 | 424 | GBLDEF jnlpool_ctl_ptr_t jnlpool_ctl; | ||
432 | 425 | GBLDEF jnlpool_ctl_struct temp_jnlpool_ctl_struct; | ||
433 | 426 | GBLDEF jnlpool_ctl_ptr_t temp_jnlpool_ctl = &temp_jnlpool_ctl_struct; | ||
434 | 427 | GBLDEF sm_uc_ptr_t jnldata_base; | ||
435 | 428 | GBLDEF int4 jnlpool_shmid = INVALID_SHMID; | ||
436 | 429 | GBLDEF recvpool_addrs recvpool; | ||
437 | 430 | GBLDEF int recvpool_shmid = INVALID_SHMID; | ||
438 | 431 | GBLDEF int gtmsource_srv_count = 0; | ||
439 | 432 | GBLDEF int gtmrecv_srv_count = 0; | ||
440 | 433 | |||
441 | 434 | /* The following _in_prog counters are needed to prevent deadlocks while doing jnl-qio (timer & non-timer). */ | ||
442 | 435 | GBLDEF volatile int4 db_fsync_in_prog; | ||
443 | 436 | GBLDEF volatile int4 jnl_qio_in_prog; | ||
444 | 437 | #ifdef UNIX | ||
445 | 438 | GBLDEF gtmsiginfo_t signal_info; | ||
446 | 439 | #ifndef MUTEX_MSEM_WAKE | ||
447 | 440 | GBLDEF int mutex_sock_fd = -1; | ||
448 | 441 | GBLDEF struct sockaddr_un mutex_sock_address; | ||
449 | 442 | GBLDEF struct sockaddr_un mutex_wake_this_proc; | ||
450 | 443 | GBLDEF int mutex_wake_this_proc_len; | ||
451 | 444 | GBLDEF int mutex_wake_this_proc_prefix_len; | ||
452 | 445 | GBLDEF fd_set mutex_wait_on_descs; | ||
453 | 446 | #endif | ||
454 | 447 | #endif | ||
455 | 448 | GBLDEF void (*call_on_signal)(); | ||
456 | 449 | GBLDEF gtmImageName gtmImageNames[n_image_types] = | ||
457 | 450 | { | ||
458 | 451 | #define IMAGE_TABLE_ENTRY(A,B) {LIT_AND_LEN(B)}, | ||
459 | 452 | #include "gtmimagetable.h" | ||
460 | 453 | #undef IMAGE_TABLE_ENTRY | ||
461 | 454 | }; | ||
462 | 455 | GBLDEF enum gtmImageTypes image_type; /* initialized at startup i.e. in dse.c, lke.c, gtm.c, mupip.c, gtmsecshr.c etc. */ | ||
463 | 456 | GBLDEF volatile boolean_t semwt2long; | ||
464 | 457 | |||
465 | 458 | #ifdef UNIX | ||
466 | 459 | GBLDEF parmblk_struct *param_list; /* call-in parameters block (defined in unix/fgncalsp.h)*/ | ||
467 | 460 | GBLDEF unsigned int invocation_mode = MUMPS_COMPILE; /* how mumps has been invoked */ | ||
468 | 461 | GBLDEF char cli_err_str[MAX_CLI_ERR_STR] = ""; /* Parse Error message buffer */ | ||
469 | 462 | GBLDEF char *cli_err_str_ptr = NULL; | ||
470 | 463 | #endif | ||
471 | 464 | |||
472 | 465 | /* this array is indexed by file descriptor */ | ||
473 | 466 | GBLDEF boolean_t *lseekIoInProgress_flags = (boolean_t *)0; | ||
474 | 467 | |||
475 | 468 | #if defined(UNIX) | ||
476 | 469 | /* Latch variable for Unix implementations. Used in SUN and HP */ | ||
477 | 470 | GBLDEF global_latch_t defer_latch; | ||
478 | 471 | #endif | ||
479 | 472 | |||
480 | 473 | GBLDEF int num_additional_processors; | ||
481 | 474 | GBLDEF int gtm_errno = -1; /* holds the errno (unix) in case of an rts_error */ | ||
482 | 475 | GBLDEF int4 error_condition = 0; | ||
483 | 476 | GBLDEF global_tlvl_info *global_tlvl_info_head; | ||
484 | 477 | GBLDEF buddy_list *global_tlvl_info_list; | ||
485 | 478 | GBLDEF boolean_t job_try_again; | ||
486 | 479 | GBLDEF volatile int4 gtmMallocDepth; /* Recursion indicator */ | ||
487 | 480 | GBLDEF d_socket_struct *socket_pool; | ||
488 | 481 | GBLDEF boolean_t disable_sigcont = FALSE; | ||
489 | 482 | GBLDEF boolean_t mu_star_specified; | ||
490 | 483 | GBLDEF backup_reg_list *mu_repl_inst_reg_list; | ||
491 | 484 | |||
492 | 485 | #ifndef VMS | ||
493 | 486 | GBLDEF volatile int suspend_status = NO_SUSPEND; | ||
494 | 487 | #endif | ||
495 | 488 | |||
496 | 489 | GBLDEF gv_namehead *reset_gv_target = INVALID_GV_TARGET; | ||
497 | 490 | GBLDEF VSIG_ATOMIC_T util_interrupt = 0; | ||
498 | 491 | GBLDEF boolean_t kip_incremented; | ||
499 | 492 | GBLDEF boolean_t need_kip_incr; | ||
500 | 493 | GBLDEF int merge_args = 0; | ||
501 | 494 | GBLDEF merge_glvn_ptr mglvnp = NULL; | ||
502 | 495 | GBLDEF int ztrap_form; | ||
503 | 496 | GBLDEF boolean_t ztrap_new; | ||
504 | 497 | GBLDEF int4 wtfini_in_prog; | ||
505 | 498 | /* items for $piece stats */ | ||
506 | 499 | #ifdef DEBUG | ||
507 | 500 | GBLDEF int c_miss; /* cache misses (debug) */ | ||
508 | 501 | GBLDEF int c_hit; /* cache hits (debug) */ | ||
509 | 502 | GBLDEF int c_small; /* scanned small string brute force */ | ||
510 | 503 | GBLDEF int c_small_pcs; /* chars scanned by small scan */ | ||
511 | 504 | GBLDEF int c_pskip; /* number of pieces "skipped" */ | ||
512 | 505 | GBLDEF int c_pscan; /* number of pieces "scanned" */ | ||
513 | 506 | GBLDEF int c_parscan; /* number of partial scans (partial cache hits) */ | ||
514 | 507 | GBLDEF int cs_miss; /* cache misses (debug) */ | ||
515 | 508 | GBLDEF int cs_hit; /* cache hits (debug) */ | ||
516 | 509 | GBLDEF int cs_small; /* scanned small string brute force */ | ||
517 | 510 | GBLDEF int cs_small_pcs; /* chars scanned by small scan */ | ||
518 | 511 | GBLDEF int cs_pskip; /* number of pieces "skipped" */ | ||
519 | 512 | GBLDEF int cs_pscan; /* number of pieces "scanned" */ | ||
520 | 513 | GBLDEF int cs_parscan; /* number of partial scans (partial cache hits) */ | ||
521 | 514 | GBLDEF int c_clear; /* cleared due to (possible) value change */ | ||
522 | 515 | GBLDEF boolean_t setp_work; | ||
523 | 516 | #endif | ||
524 | 517 | GBLDEF z_records zbrk_recs = {NULL, NULL, NULL}; | ||
525 | 518 | |||
526 | 519 | #ifdef UNIX | ||
527 | 520 | GBLDEF ipcs_mesg db_ipcs; /* For requesting gtmsecshr to update ipc fields */ | ||
528 | 521 | GBLDEF gd_region *ftok_sem_reg = NULL; /* Last region for which ftok semaphore is grabbed */ | ||
529 | 522 | GBLDEF gd_region *standalone_reg = NULL; /* We have standalone access for this region */ | ||
530 | 523 | GBLDEF int gtm_non_blocked_write_retries; /* number of retries for non-blocked write to pipe */ | ||
531 | 524 | #endif | ||
532 | 525 | |||
533 | 526 | #ifdef VMS | ||
534 | 527 | /* Following global variables store the state of an erroring sys$qio just before a GTMASSERT in the CHECK_CHANNEL_STATUS macro */ | ||
535 | 528 | GBLDEF uint4 check_channel_status = 0; /* stores the qio return status */ | ||
536 | 529 | GBLDEF uint4 check_channel_id = 0; /* stores the qio channel id */ | ||
537 | 530 | #endif | ||
538 | 531 | |||
539 | 532 | GBLDEF boolean_t write_after_image = FALSE; /* true for after-image jnlrecord writing by recover/rollback */ | ||
540 | 533 | GBLDEF int iott_write_error; | ||
541 | 534 | GBLDEF boolean_t recovery_success = FALSE; /* To Indicate successful recovery */ | ||
542 | 535 | GBLDEF int4 write_filter; | ||
543 | 536 | GBLDEF int4 zdate_form = 0; | ||
544 | 537 | GBLDEF boolean_t need_no_standalone = FALSE; | ||
545 | 538 | |||
546 | 539 | GBLDEF int4 zdir_form = ZDIR_FORM_FULLPATH; /* $ZDIR shows full path including DEVICE and DIRECTORY */ | ||
547 | 540 | GBLDEF mval dollar_zdir = DEFINE_MVAL_LITERAL(MV_STR, 0, 0, 0, NULL, 0, 0); | ||
548 | 541 | |||
549 | 542 | GBLDEF int * volatile var_on_cstack_ptr = NULL; /* volatile pointer to int; volatile so that nothing gets optimized out */ | ||
550 | 543 | GBLDEF boolean_t gtm_environment_init = FALSE; | ||
551 | 544 | GBLDEF hash_table_int4 cw_stagnate; | ||
552 | 545 | GBLDEF boolean_t cw_stagnate_reinitialized = FALSE; | ||
553 | 546 | |||
554 | 547 | GBLDEF uint4 pat_everything[] = { 0, 2, PATM_E, 1, 0, PAT_MAX_REPEAT, 0, PAT_MAX_REPEAT, 1 }; /* pattern = ".e" */ | ||
555 | 548 | GBLDEF mstr_len_t sizeof_pat_everything = SIZEOF(pat_everything); | ||
556 | 549 | |||
557 | 550 | GBLDEF uint4 *pattern_typemask; | ||
558 | 551 | GBLDEF pattern *pattern_list; | ||
559 | 552 | GBLDEF pattern *curr_pattern; | ||
560 | 553 | |||
561 | 554 | /* Unicode related data */ | ||
562 | 555 | GBLDEF boolean_t gtm_utf8_mode; /* Is GT.M running with Unicode Character Set; Set only after ICU initialization */ | ||
563 | 556 | GBLDEF boolean_t is_gtm_chset_utf8; /* Is gtm_chset environment variable set to UTF8 */ | ||
564 | 557 | GBLDEF boolean_t utf8_patnumeric; /* Should patcode N match non-ASCII numbers in pattern match ? */ | ||
565 | 558 | GBLDEF boolean_t badchar_inhibit = FALSE;/* Suppress malformed UTF-8 characters by default */ | ||
566 | 559 | GBLDEF MSTR_DEF(dollar_zchset, 1, "M"); | ||
567 | 560 | GBLDEF MSTR_DEF(dollar_zpatnumeric, 1, "M"); | ||
568 | 561 | |||
569 | 562 | /* Standard MUMPS pattern-match table. | ||
570 | 563 | * This table holds the current pattern-matching attributes of each ASCII character. | ||
571 | 564 | * Bits 0..23 of each entry correspond with the pattern-match characters, A..X. | ||
572 | 565 | */ | ||
573 | 566 | GBLDEF pattern mumps_pattern = { | ||
574 | 567 | (void *) 0, /* flink */ | ||
575 | 568 | (void *) 0, /* typemask */ | ||
576 | 569 | (void *) 0, /* pat YZ name array */ | ||
577 | 570 | (void *) 0, /* pat YZ name-length array */ | ||
578 | 571 | -1, /* number of YZ patcodes */ | ||
579 | 572 | 1, /* namlen */ | ||
580 | 573 | {'M', '\0'} /* name */ | ||
581 | 574 | }; | ||
582 | 575 | |||
583 | 576 | /* mapbit is used by pattab.c and patstr.c. Note that patstr.c uses only entries until PATM_X */ | ||
584 | 577 | GBLDEF readonly uint4 mapbit[] = | ||
585 | 578 | { | ||
586 | 579 | PATM_A, PATM_B, PATM_C, PATM_D, PATM_E, PATM_F, PATM_G, PATM_H, | ||
587 | 580 | PATM_I, PATM_J, PATM_K, PATM_L, PATM_M, PATM_N, PATM_O, PATM_P, | ||
588 | 581 | PATM_Q, PATM_R, PATM_S, PATM_T, PATM_U, PATM_V, PATM_W, PATM_X, | ||
589 | 582 | PATM_YZ1, PATM_YZ2, PATM_YZ3, PATM_YZ4 | ||
590 | 583 | }; | ||
591 | 584 | |||
592 | 585 | LITDEF uint4 typemask[PATENTS] = | ||
593 | 586 | { | ||
594 | 587 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 00-07 : ASCII characters */ | ||
595 | 588 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 08-0F : ASCII characters */ | ||
596 | 589 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 10-17 : ASCII characters */ | ||
597 | 590 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 18-1F : ASCII characters */ | ||
598 | 591 | PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex 20-27 : ASCII characters */ | ||
599 | 592 | PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex 28-2F : ASCII characters */ | ||
600 | 593 | PATM_N, PATM_N, PATM_N, PATM_N, PATM_N, PATM_N, PATM_N, PATM_N, /* hex 30-37 : ASCII characters */ | ||
601 | 594 | PATM_N, PATM_N, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex 38-3F : ASCII characters */ | ||
602 | 595 | PATM_P, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex 40-47 : ASCII characters */ | ||
603 | 596 | PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex 48-4F : ASCII characters */ | ||
604 | 597 | PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex 50-57 : ASCII characters */ | ||
605 | 598 | PATM_U, PATM_U, PATM_U, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex 58-5F : ASCII characters */ | ||
606 | 599 | PATM_P, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex 60-67 : ASCII characters */ | ||
607 | 600 | PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex 68-6F : ASCII characters */ | ||
608 | 601 | PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex 70-77 : ASCII characters */ | ||
609 | 602 | PATM_L, PATM_L, PATM_L, PATM_P, PATM_P, PATM_P, PATM_P, PATM_C, /* hex 78-7F : ASCII characters */ | ||
610 | 603 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 80-87 : non-ASCII characters */ | ||
611 | 604 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 88-8F : non-ASCII characters */ | ||
612 | 605 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 90-97 : non-ASCII characters */ | ||
613 | 606 | PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, PATM_C, /* hex 98-9F : non-ASCII characters */ | ||
614 | 607 | PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex A0-A7 : non-ASCII characters */ | ||
615 | 608 | PATM_P, PATM_P, PATM_L, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex A8-AF : non-ASCII characters */ | ||
616 | 609 | PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex B0-B7 : non-ASCII characters */ | ||
617 | 610 | PATM_P, PATM_P, PATM_L, PATM_P, PATM_P, PATM_P, PATM_P, PATM_P, /* hex B8-BF : non-ASCII characters */ | ||
618 | 611 | PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex C0-C7 : non-ASCII characters */ | ||
619 | 612 | PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex C8-CF : non-ASCII characters */ | ||
620 | 613 | PATM_P, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, /* hex D0-D7 : non-ASCII characters */ | ||
621 | 614 | PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_U, PATM_P, PATM_L, /* hex D8-DF : non-ASCII characters */ | ||
622 | 615 | PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex E0-E7 : non-ASCII characters */ | ||
623 | 616 | PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex E8-EF : non-ASCII characters */ | ||
624 | 617 | PATM_P, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, /* hex F0-F7 : non-ASCII characters */ | ||
625 | 618 | PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_L, PATM_P, PATM_C /* hex F8-FF : non-ASCII characters */ | ||
626 | 619 | }; | ||
627 | 620 | |||
628 | 621 | GBLDEF uint4 pat_allmaskbits; /* universal set of valid pattern bit codes for currently active pattern table */ | ||
629 | 622 | |||
630 | 623 | /* globals related to caching of pattern evaluation match result. | ||
631 | 624 | * for a given <strptr, strlen, patptr, depth> tuple, we store the evaluation result. | ||
632 | 625 | * in the above, | ||
633 | 626 | * <strptr, strlen> uniquely identifies a substring of the input string. | ||
634 | 627 | * <patptr> identifies the pattern atom that we are matching with | ||
635 | 628 | * <depth> identifies the recursion depth of do_patalt() for this pattern atom ("repcnt" in code) | ||
636 | 629 | * note that <depth> is a necessity in the above because the same alternation pattern atom can have different | ||
637 | 630 | * match or not-match status for the same input string depending on the repetition count usage of the pattern atom | ||
638 | 631 | * after a series of thoughts on an efficient structure for storing pattern evaluation, finally arrived at a simple | ||
639 | 632 | * array of structures wherein for a given length (strlen) we have a fixed number of structures available. | ||
640 | 633 | * we allocate an array of structures, say, 1024 structures. | ||
641 | 634 | * this is a simple 1-1 mapping, wherein | ||
642 | 635 | * for length 0, the available structures are the first 32 structures of the array, | ||
643 | 636 | * for length 1, the available structures are the second 32 structures of the array. | ||
644 | 637 | * ... | ||
645 | 638 | * for length 47, the available structures are the 47th 32 structures of the array. | ||
646 | 639 | * for length 48 and above, the available structures are all the remaining structures of the array. | ||
647 | 640 | * whenever any new entry needs to be cached and there is no room among the available structures, we preempt the | ||
648 | 641 | * most unfrequently used cache entry (to do this we do keep a count of every entry's frequency of usage) | ||
649 | 642 | * the assumption is that substrings of length > 48 (an arbitrary reasonable small number) won't be used | ||
650 | 643 | * so frequently so that they have lesser entries to fight for among themselves than lower values of length. | ||
651 | 644 | * with the above caching in place, the program segment below took 15 seconds. | ||
652 | 645 | * it was found that if the array size is increased to 16384 (as opposed to 1024 as above) and the available | ||
653 | 646 | * structures for each length increased proportionally (i.e. 16 times = 16*32 structures instead of 32 as above) | ||
654 | 647 | * the performance improved to the extent of taking 3 seconds. | ||
655 | 648 | * but this raised an interesting question, that of "size" vs. "time" tradeoff. | ||
656 | 649 | * with increasing array size, we get better "time" performance due to better caching. | ||
657 | 650 | * but that has an overhead of increased "size" (memory) usage. | ||
658 | 651 | * to arrive at a compromise, a dynamic algorithm emerged. the process will allocate a small array | ||
659 | 652 | * beginning at 1024 entries and grow to a max of 16384 entries as and when it deems the hit ratio is not good. | ||
660 | 653 | * the array only grows, i.e. there is no downsizing algorithm at play. | ||
661 | 654 | * the dynamic algorithm addresses to an extent both the "size" and "time" issues and finishes the below in 1 second. | ||
662 | 655 | * #defines for the dynamic algorithm growth can be found in patcode.h | ||
663 | 656 | */ | ||
664 | 657 | GBLDEF int4 curalt_depth = -1; /* depth of alternation nesting */ | ||
665 | 658 | GBLDEF int4 do_patalt_calls[PTE_MAX_CURALT_DEPTH]; /* number of calls to do_patalt() */ | ||
666 | 659 | GBLDEF int4 do_patalt_hits[PTE_MAX_CURALT_DEPTH]; /* number of pte_csh hits in do_patalt() */ | ||
667 | 660 | GBLDEF int4 do_patalt_maxed_out[PTE_MAX_CURALT_DEPTH]; /* no. of pte_csh misses after maxing on allocation size */ | ||
668 | 661 | |||
669 | 662 | GBLDEF pte_csh *pte_csh_array[PTE_MAX_CURALT_DEPTH]; /* pte_csh array (per curalt_depth) */ | ||
670 | 663 | GBLDEF int4 pte_csh_cur_size[PTE_MAX_CURALT_DEPTH]; /* current pte_csh size (per curalt_depth) */ | ||
671 | 664 | GBLDEF int4 pte_csh_alloc_size[PTE_MAX_CURALT_DEPTH]; /* current allocated pte_csh size (per curalt_depth) */ | ||
672 | 665 | GBLDEF int4 pte_csh_entries_per_len[PTE_MAX_CURALT_DEPTH]; /* current number of entries per len */ | ||
673 | 666 | GBLDEF int4 pte_csh_tail_count[PTE_MAX_CURALT_DEPTH]; /* count of non 1-1 corresponding pte_csh_array members */ | ||
674 | 667 | |||
675 | 668 | GBLDEF pte_csh *cur_pte_csh_array; /* copy of pte_csh_array corresponding to curalt_depth */ | ||
676 | 669 | GBLDEF int4 cur_pte_csh_size; /* copy of pte_csh_cur_size corresponding to curalt_depth */ | ||
677 | 670 | GBLDEF int4 cur_pte_csh_entries_per_len; /* copy of pte_csh_entries_per_len corresponding to curalt_depth */ | ||
678 | 671 | GBLDEF int4 cur_pte_csh_tail_count; /* copy of pte_csh_tail_count corresponding to curalt_depth */ | ||
679 | 672 | |||
680 | 673 | GBLDEF readonly char *before_image_lit[] = {"NOBEFORE_IMAGES", "BEFORE_IMAGES"}; | ||
681 | 674 | GBLDEF readonly char *jnl_state_lit[] = {"DISABLED", "OFF", "ON"}; | ||
682 | 675 | GBLDEF readonly char *repl_state_lit[] = {"OFF", "ON", "WAS_ON"}; | ||
683 | 676 | |||
684 | 677 | GBLDEF boolean_t crit_sleep_expired; /* mutex.mar: signals that a timer waiting for crit has expired */ | ||
685 | 678 | GBLDEF uint4 crit_deadlock_check_cycle; /* compared to csa->crit_check_cycle to determine if a given region | ||
686 | 679 | in a transaction legitimately has crit or not */ | ||
687 | 680 | GBLDEF node_local_ptr_t locknl; /* if non-NULL, indicates node-local of interest to the LOCK_HIST macro */ | ||
688 | 681 | GBLDEF boolean_t in_mutex_deadlock_check; /* if TRUE, mutex_deadlock_check() is part of our current C-stack trace */ | ||
689 | 682 | /* $ECODE and $STACK related variables. | ||
690 | 683 | * error_frame and skip_error_ret should ideally be part of dollar_ecode structure. since sr_avms/opp_ret.m64 uses these | ||
691 | 684 | * global variables and it was felt risky changing it to access a member of a structure, they are kept as separate globals */ | ||
692 | 685 | GBLDEF stack_frame *error_frame; /* ptr to frame where last error occurred or was rethrown */ | ||
693 | 686 | GBLDEF boolean_t skip_error_ret; /* set to TRUE by golevel(), used and reset by op_unwind() */ | ||
694 | 687 | GBLDEF dollar_ecode_type dollar_ecode; /* structure containing $ECODE related information */ | ||
695 | 688 | GBLDEF dollar_stack_type dollar_stack; /* structure containing $STACK related information */ | ||
696 | 689 | GBLDEF boolean_t ztrap_explicit_null; /* whether $ZTRAP was explicitly set to NULL in the current frame */ | ||
697 | 690 | GBLDEF int4 gtm_object_size; /* Size of entire gtm object for compiler use */ | ||
698 | 691 | GBLDEF int4 linkage_size; /* Size of linkage section during compile */ | ||
699 | 692 | GBLDEF uint4 lnkrel_cnt; /* number of entries in linkage Psect to relocate */ | ||
700 | 693 | GBLDEF int4 sym_table_size; /* size of the symbol table during compilation */ | ||
701 | 694 | GBLDEF boolean_t disallow_forced_expansion, forced_expansion; /* Used in stringpool managment */ | ||
702 | 695 | GBLDEF jnl_fence_control jnl_fence_ctl; | ||
703 | 696 | GBLDEF jnl_process_vector *prc_vec = NULL; /* for current process */ | ||
704 | 697 | GBLDEF jnl_process_vector *originator_prc_vec = NULL; /* for client/originator */ | ||
705 | 698 | LITDEF char *jrt_label[JRT_RECTYPES] = | ||
706 | 699 | { | ||
707 | 700 | #define JNL_TABLE_ENTRY(rectype, extract_rtn, label, update, fixed_size, is_replicated) label, | ||
708 | 701 | #include "jnl_rec_table.h" | ||
709 | 702 | #undef JNL_TABLE_ENTRY | ||
710 | 703 | }; | ||
711 | 704 | LITDEF int jrt_update[JRT_RECTYPES] = | ||
712 | 705 | { | ||
713 | 706 | #define JNL_TABLE_ENTRY(rectype, extract_rtn, label, update, fixed_size, is_replicated) update, | ||
714 | 707 | #include "jnl_rec_table.h" | ||
715 | 708 | #undef JNL_TABLE_ENTRY | ||
716 | 709 | }; | ||
717 | 710 | LITDEF boolean_t jrt_fixed_size[JRT_RECTYPES] = | ||
718 | 711 | { | ||
719 | 712 | #define JNL_TABLE_ENTRY(rectype, extract_rtn, label, update, fixed_size, is_replicated) fixed_size, | ||
720 | 713 | #include "jnl_rec_table.h" | ||
721 | 714 | #undef JNL_TABLE_ENTRY | ||
722 | 715 | }; | ||
723 | 716 | LITDEF boolean_t jrt_is_replicated[JRT_RECTYPES] = | ||
724 | 717 | { | ||
725 | 718 | #define JNL_TABLE_ENTRY(rectype, extract_rtn, label, update, fixed_size, is_replicated) is_replicated, | ||
726 | 719 | #include "jnl_rec_table.h" | ||
727 | 720 | #undef JNL_TABLE_ENTRY | ||
728 | 721 | }; | ||
729 | 722 | /* Change the initialization if struct_jrec_tcom in jnl.h changes */ | ||
730 | 723 | GBLDEF struct_jrec_tcom tcom_record = {{JRT_TCOM, TCOM_RECLEN, 0, 0, 0}, | ||
731 | 724 | 0, "", 0, {TCOM_RECLEN, JNL_REC_SUFFIX_CODE}}; | ||
732 | 725 | GBLDEF jnl_gbls_t jgbl; | ||
733 | 726 | GBLDEF short crash_count; | ||
734 | 727 | GBLDEF trans_num start_tn; | ||
735 | 728 | GBLDEF cw_set_element cw_set[CDB_CW_SET_SIZE]; | ||
736 | 729 | GBLDEF unsigned char cw_set_depth, cw_map_depth; | ||
737 | 730 | GBLDEF unsigned int t_tries; | ||
738 | 731 | GBLDEF uint4 t_err; | ||
739 | 732 | GBLDEF int4 update_trans; /* TRUE whenever a non-TP transaction needs to increment the database transaction number. | ||
740 | 733 | * usually TRUE if cw_set_depth/cw_map_depth of the current non-TP transaction is non-zero, | ||
741 | 734 | * but additionally TRUE in case of a redundant set in gvcst_put.c | ||
742 | 735 | * can take on a special value T_COMMIT_STARTED in t_end/tp_tend hence is not "boolean_t" | ||
743 | 736 | */ | ||
744 | 737 | GBLDEF boolean_t mu_rndwn_file_dbjnl_flush; /* to indicate standalone access is available to shared memory so | ||
745 | 738 | * wcs_recover() need not increment db curr_tn or write inctn record */ | ||
746 | 739 | |||
747 | 740 | GBLDEF boolean_t is_uchar_wcs_code[] = /* uppercase failure codes that imply database cache related problem */ | ||
748 | 741 | { /* if any of the following failure codes are seen in the final retry, wc_blocked will be set to trigger cache recovery */ | ||
749 | 742 | #define CDB_SC_NUM_ENTRY(code, value) | ||
750 | 743 | #define CDB_SC_UCHAR_ENTRY(code, is_wcs_code, value) is_wcs_code, | ||
751 | 744 | #define CDB_SC_LCHAR_ENTRY(code, is_wcs_code, value) | ||
752 | 745 | #include "cdb_sc_table.h" | ||
753 | 746 | #undef CDB_SC_NUM_ENTRY | ||
754 | 747 | #undef CDB_SC_UCHAR_ENTRY | ||
755 | 748 | #undef CDB_SC_LCHAR_ENTRY | ||
756 | 749 | }; | ||
757 | 750 | |||
758 | 751 | GBLDEF boolean_t is_lchar_wcs_code[] = /* lowercase failure codes that imply database cache related problem */ | ||
759 | 752 | { /* if any of the following failure codes are seen in the final retry, wc_blocked will be set to trigger cache recovery */ | ||
760 | 753 | #define CDB_SC_NUM_ENTRY(code, value) | ||
761 | 754 | #define CDB_SC_UCHAR_ENTRY(code, is_wcs_code, value) | ||
762 | 755 | #define CDB_SC_LCHAR_ENTRY(code, is_wcs_code, value) is_wcs_code, | ||
763 | 756 | #include "cdb_sc_table.h" | ||
764 | 757 | #undef CDB_SC_NUM_ENTRY | ||
765 | 758 | #undef CDB_SC_UCHAR_ENTRY | ||
766 | 759 | #undef CDB_SC_LCHAR_ENTRY | ||
767 | 760 | }; | ||
768 | 761 | |||
769 | 762 | GBLDEF mval last_fnquery_return_varname; /* Return value of last $QUERY (on stringpool) (varname) */ | ||
770 | 763 | GBLDEF mval last_fnquery_return_sub[MAX_LVSUBSCRIPTS]; /* .. (subscripts) */ | ||
771 | 764 | GBLDEF int last_fnquery_return_subcnt ; /* .. (count of subscripts) */ | ||
772 | 765 | |||
773 | 766 | GBLDEF boolean_t gvdupsetnoop = FALSE; /* if TRUE, duplicate SETs do not change GDS block (and therefore no PBLK journal | ||
774 | 767 | * records will be written) although the database transaction number will be | ||
775 | 768 | * incremented and logical SET journal records will be written. | ||
776 | 769 | */ | ||
777 | 770 | GBLDEF boolean_t gtm_fullblockwrites; /* Do full (not partial) database block writes T/F */ | ||
778 | 771 | UNIX_ONLY(GBLDEF int4 gtm_shmflags;) /* Extra flags for shmat */ | ||
779 | 772 | #ifdef VMS | ||
780 | 773 | GBLDEF uint4 gtm_memory_noaccess_defined; /* count of the number of GTM_MEMORY_NOACCESS_ADDR logicals which are defined */ | ||
781 | 774 | GBLDEF uint4 gtm_memory_noaccess[GTM_MEMORY_NOACCESS_COUNT]; /* see VMS gtm_env_init_sp.c */ | ||
782 | 775 | #endif | ||
783 | 776 | |||
784 | 777 | GBLDEF volatile boolean_t in_wcs_recover = FALSE; /* TRUE if in wcs_recover(), used by "bt_put" and "generic_exit_handler" */ | ||
785 | 778 | |||
786 | 779 | /* Following definitions are related to white_box testing */ | ||
787 | 780 | GBLDEF boolean_t gtm_white_box_test_case_enabled = FALSE; | ||
788 | 781 | GBLDEF int gtm_white_box_test_case_number = 0; | ||
789 | 782 | GBLDEF int gtm_white_box_test_case_count = 0; | ||
790 | 783 | GBLDEF int gtm_wbox_input_test_case_count = 0; /* VMS allows maximum 31 characters for external identifer */ | ||
791 | 784 | |||
792 | 785 | GBLDEF boolean_t in_gvcst_incr = FALSE; /* set to TRUE by gvcst_incr, set to FALSE by gvcst_put | ||
793 | 786 | * distinguishes to gvcst_put, if the current db operation is a SET or $INCR */ | ||
794 | 787 | GBLDEF mval *post_incr_mval; /* mval pointing to the post-$INCR value */ | ||
795 | 788 | GBLDEF mval increment_delta_mval; /* mval holding the INTEGER increment value, set by gvcst_incr, | ||
796 | 789 | * used by gvcst_put/gvincr_recompute_upd_array which is invoked by t_end */ | ||
797 | 790 | GBLDEF boolean_t is_dollar_incr = FALSE; /* valid only if gvcst_put is in the call-stack (i.e. t_err == ERR_GVPUTFAIL); | ||
798 | 791 | * is a copy of "in_gvcst_incr" just before it got reset to FALSE */ | ||
799 | 792 | GBLDEF boolean_t pre_incr_update_trans; /* copy of "sgm_info_ptr->update_trans" before the $INCR */ | ||
800 | 793 | GBLDEF int indir_cache_mem_size; /* Amount of memory currently in use by indirect cache */ | ||
801 | 794 | GBLDEF hash_table_mname rt_name_tbl; | ||
802 | 795 | GBLDEF hash_table_objcode cache_table; | ||
803 | 796 | GBLDEF int cache_hits, cache_fails; | ||
804 | 797 | |||
805 | 798 | /* The alignment feature is disabled due to some issues in stringpool garbage collection. | ||
806 | 799 | * TODO: When we sort out stringpool issues, change mstr_native_align to TRUE below */ | ||
807 | 800 | GBLDEF boolean_t mstr_native_align = FALSE; | ||
808 | 801 | GBLDEF boolean_t save_mstr_native_align; | ||
809 | 802 | |||
810 | 803 | GBLDEF mvar *mvartab; | ||
811 | 804 | GBLDEF mvax *mvaxtab,*mvaxtab_end; | ||
812 | 805 | GBLDEF mlabel *mlabtab; | ||
813 | 806 | GBLDEF mline mline_root; | ||
814 | 807 | GBLDEF mline *mline_tail; | ||
815 | 808 | GBLDEF short int block_level; | ||
816 | 809 | GBLDEF triple t_orig; | ||
817 | 810 | GBLDEF int mvmax, mlmax, mlitmax; | ||
818 | 811 | static char routine_name_buff[sizeof(mident_fixed)], module_name_buff[sizeof(mident_fixed)]; | ||
819 | 812 | GBLDEF MIDENT_DEF(routine_name, 0, &routine_name_buff[0]); | ||
820 | 813 | GBLDEF MIDENT_DEF(module_name, 0, &module_name_buff[0]); | ||
821 | 814 | GBLDEF char rev_time_buf[REV_TIME_BUFF_LEN]; | ||
822 | 815 | GBLDEF unsigned short source_name_len; | ||
823 | 816 | GBLDEF short object_name_len; | ||
824 | 817 | UNIX_ONLY( | ||
825 | 818 | GBLDEF unsigned char source_file_name[MAX_FBUFF + 1]; | ||
826 | 819 | GBLDEF unsigned char object_file_name[MAX_FBUFF + 1]; | ||
827 | 820 | GBLDEF int object_file_des; | ||
828 | 821 | ) | ||
829 | 822 | VMS_ONLY( | ||
830 | 823 | GBLDEF char source_file_name[PATH_MAX]; | ||
831 | 824 | GBLDEF char object_file_name[256]; | ||
832 | 825 | GBLDEF struct FAB obj_fab; /* file access block for the object file */ | ||
833 | 826 | ) | ||
834 | 827 | |||
835 | 828 | GBLDEF int4 curr_addr, code_size; | ||
836 | 829 | GBLDEF mident_fixed zlink_mname; | ||
837 | 830 | GBLDEF boolean_t in_op_fnnext = FALSE; /* set to TRUE by op_fnnext, set to FALSE by op_fnorder */ | ||
838 | 831 | |||
839 | 832 | GBLDEF sm_uc_ptr_t reformat_buffer; | ||
840 | 833 | GBLDEF int reformat_buffer_len; | ||
841 | 834 | GBLDEF volatile int reformat_buffer_in_use; /* used only in DEBUG mode */ | ||
842 | 835 | |||
843 | 836 | GBLDEF boolean_t mu_reorg_upgrd_dwngrd_in_prog; /* TRUE if MUPIP REORG UPGRADE/DOWNGRADE is in progress */ | ||
844 | 837 | GBLDEF boolean_t mu_reorg_nosafejnl; /* TRUE if NOSAFEJNL explicitly specified */ | ||
845 | 838 | GBLDEF trans_num mu_reorg_upgrd_dwngrd_blktn; /* tn in blkhdr of current block processed by MUPIP REORG {UP,DOWN}GRADE */ | ||
846 | 839 | |||
847 | 840 | GBLDEF inctn_opcode_t inctn_opcode = inctn_invalid_op; | ||
848 | 841 | GBLDEF inctn_detail_t inctn_detail; /* holds detail to fill in to inctn jnl record */ | ||
849 | 842 | GBLDEF uint4 region_open_count; /* Number of region "opens" we have executed */ | ||
850 | 843 | |||
851 | 844 | GBLDEF uint4 gtm_blkupgrade_flag = UPGRADE_IF_NEEDED; /* by default upgrade only if necessary */ | ||
852 | 845 | GBLDEF boolean_t disk_blk_read; | ||
853 | 846 | |||
854 | 847 | GBLDEF boolean_t gtm_dbfilext_syslog_disable = FALSE; /* by default, log every file extension message */ | ||
855 | 848 | |||
856 | 849 | GBLDEF int4 cws_reorg_remove_index; /* see mu_swap_blk.c for comments on the need for these two */ | ||
857 | 850 | GBLDEF block_id cws_reorg_remove_array[CWS_REORG_REMOVE_ARRAYSIZE]; | ||
858 | 851 | |||
859 | 852 | GBLDEF uint4 log_interval; | ||
860 | 853 | |||
861 | 854 | #ifdef UNIX | ||
862 | 855 | GBLDEF uint4 gtm_principal_editing_defaults; /* ext_cap flags if tt */ | ||
863 | 856 | GBLDEF boolean_t in_repl_inst_edit = FALSE; /* used by an assert in repl_inst_read/repl_inst_write */ | ||
864 | 857 | GBLDEF boolean_t in_repl_inst_create; /* used by repl_inst_read/repl_inst_write */ | ||
865 | 858 | GBLDEF boolean_t holds_sem[NUM_SEM_SETS][NUM_SRC_SEMS]; /* whether a particular replication semaphore is being held | ||
866 | 859 | * by the current process or not. */ | ||
867 | 860 | GBLDEF boolean_t print_offset; /* Set to TRUE if -DETAIL is specified in MUPIP REPLIC -JNLPOOL or -EDITINST */ | ||
868 | 861 | GBLDEF boolean_t in_mupip_ftok; /* Used by an assert in repl_inst_read */ | ||
869 | 862 | GBLDEF uint4 section_offset; /* Used by PRINT_OFFSET_PREFIX macro in repl_inst_dump.c */ | ||
870 | 863 | |||
871 | 864 | GBLDEF uint4 mutex_per_process_init_pid; /* pid that invoked "mutex_per_process_init" */ | ||
872 | 865 | GBLDEF boolean_t gtm_quiet_halt; /* Suppress FORCEDHALT message */ | ||
873 | 866 | #endif | ||
874 | 867 | |||
875 | 868 | #ifdef UNICODE_SUPPORTED | ||
876 | 869 | /* Unicode line terminators. In addition to the following | ||
877 | 870 | * codepoints, the sequence CR LF is considered a single | ||
878 | 871 | * line terminator. | ||
879 | 872 | */ | ||
880 | 873 | LITDEF UChar32 u32_line_term[] = | ||
881 | 874 | { | ||
882 | 875 | 0x000A, /* Line Feed */ | ||
883 | 876 | 0x000D, /* Carraige Return */ | ||
884 | 877 | 0x0085, /* Next Line - EBCDIC mostly */ | ||
885 | 878 | 0x000C, /* Form Feed */ | ||
886 | 879 | UTF_LINE_SEPARATOR, /* Line Separator */ | ||
887 | 880 | UTF_PARA_SEPARATOR, /* Paragraph Separator */ | ||
888 | 881 | 0x0000 | ||
889 | 882 | }; | ||
890 | 883 | |||
891 | 884 | /* Given the first byte in a UTF-8 representation, the following array returns the total number of bytes in the encoding | ||
892 | 885 | * 00-7F : 1 byte | ||
893 | 886 | * C2-DF : 2 bytes | ||
894 | 887 | * E0-EF : 3 bytes | ||
895 | 888 | * F0-F4 : 4 bytes | ||
896 | 889 | * All others: 1 byte | ||
897 | 890 | * For details on the UTF-8 encoding see gtm_utf8.h | ||
898 | 891 | */ | ||
899 | 892 | LITDEF unsigned int utf8_bytelen[] = | ||
900 | 893 | { | ||
901 | 894 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00-1F */ | ||
902 | 895 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20-3F */ | ||
903 | 896 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40-5F */ | ||
904 | 897 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60-7F */ | ||
905 | 898 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 80-9F */ | ||
906 | 899 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* A0-BF */ | ||
907 | 900 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* C0-DF */ | ||
908 | 901 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* E0-FF */ | ||
909 | 902 | }; | ||
910 | 903 | |||
911 | 904 | /* Given the first byte in a UTF-8 representation, the following array returns the number of bytes to follow | ||
912 | 905 | * 00-7F : 0 byte | ||
913 | 906 | * C2-DF : 1 byte | ||
914 | 907 | * E0-EF : 2 bytes | ||
915 | 908 | * F0-F4 : 3 bytes | ||
916 | 909 | * All others: -1 bytes | ||
917 | 910 | * For details on the UTF-8 encoding see gtm_utf8.h | ||
918 | 911 | */ | ||
919 | 912 | LITDEF signed int utf8_followlen[] = | ||
920 | 913 | { | ||
921 | 914 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00-1F */ | ||
922 | 915 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20-3F */ | ||
923 | 916 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 40-5F */ | ||
924 | 917 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60-7F */ | ||
925 | 918 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-9F */ | ||
926 | 919 | -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-BF */ | ||
927 | 920 | -1,-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* C0-DF */ | ||
928 | 921 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-FF */ | ||
929 | 922 | }; | ||
930 | 923 | |||
931 | 924 | GBLDEF gtm_wcswidth_fnptr_t gtm_wcswidth_fnptr; /* see comment in gtm_utf8.h about this typedef */ | ||
932 | 925 | #endif | ||
933 | 926 | |||
934 | 927 | GBLDEF uint4 gtm_max_sockets; /* Maximum sockets per socket device supported by this process */ | ||
935 | 928 | GBLDEF d_socket_struct *newdsocket; /* Commonly used temp socket area */ | ||
936 | 929 | |||
937 | 930 | GBLDEF boolean_t dse_all_dump; /* TRUE if DSE ALL -DUMP is specified */ | ||
938 | 931 | GBLDEF int socketus_interruptus; /* How many times socket reads have been interrutped */ | ||
939 | 932 | |||
940 | 933 | GBLDEF int4 pending_errtriplecode; /* if non-zero contains the error code to invoke ins_errtriple with */ | ||
941 | 934 | |||
942 | 935 | GBLDEF uint4 process_id; | ||
943 | 936 | GBLDEF uint4 image_count; /* not used in UNIX but defined to preserve VMS compatibility */ | ||
944 | 937 | |||
945 | 938 | GBLDEF size_t totalRmalloc; /* Total storage currently (real) malloc'd (includes extent blocks) */ | ||
946 | 939 | GBLDEF size_t totalAlloc; /* Total allocated (includes allocation overhead but not free space */ | ||
947 | 940 | GBLDEF size_t totalUsed; /* Sum of user allocated portions (totalAlloc - overhead) */ | ||
948 | 941 | |||
949 | 942 | GBLDEF size_t totalRallocGta; /* Total storage currently (real) mmap alloc'd */ | ||
950 | 943 | GBLDEF size_t totalAllocGta; /* Total mmap allocated (includes allocation overhead but not free space */ | ||
951 | 944 | GBLDEF size_t totalUsedGta; /* Sum of "in-use" portions (totalAllocGta - overhead) */ | ||
952 | 945 | |||
953 | 946 | GBLDEF volatile char *outOfMemoryMitigation; /* Cache that we will freed to help cleanup if run out of memory */ | ||
954 | 947 | GBLDEF uint4 outOfMemoryMitigateSize;/* Size of above cache (in Kbytes) */ | ||
955 | 948 | |||
956 | 949 | GBLDEF int mcavail; | ||
957 | 950 | GBLDEF mcalloc_hdr *mcavailptr, *mcavailbase; | ||
958 | 951 | |||
959 | 952 | GBLDEF uint4 max_cache_memsize; /* Maximum bytes used for indirect cache object code */ | ||
960 | 953 | GBLDEF uint4 max_cache_entries; /* Maximum number of cached indirect compilations */ | ||
961 | 954 | |||
962 | 955 | GBLDEF void (*cache_table_relobjs)(void); /* Function pointer to call cache_table_rebuild() */ | ||
963 | 956 | UNIX_ONLY(GBLDEF ch_ret_type (*ht_rhash_ch)();) /* Function pointer to hashtab_rehash_ch */ | ||
964 | 957 | UNIX_ONLY(GBLDEF ch_ret_type (*jbxm_dump_ch)();) /* Function pointer to jobexam_dump_ch */ | ||
965 | 958 | |||
966 | 959 | #ifdef VMS | ||
967 | 960 | GBLDEF boolean_t tp_has_kill_t_cse; /* cse->mode of kill_t_write or kill_t_create got created in this transaction */ | ||
968 | 961 | #endif | ||
969 | 962 | |||
970 | 963 | #ifdef DEBUG | ||
971 | 964 | /* Set to TRUE in a few selected places before wcs_recover is called. Any other place that calls wcs_recover in the final | ||
972 | 965 | * retry will fail an assert as we dont want to call cache recovery while in the middle of a transaction and confuse ourselves | ||
973 | 966 | * enough to cause further restarts (which is an out-of-design situation while in the final retry). | ||
974 | 967 | */ | ||
975 | 968 | GBLDEF boolean_t ok_to_call_wcs_recover; | ||
976 | 969 | GBLDEF uint4 donot_commit; /* see gdsfhead.h for purpose of this debug-only global */ | ||
977 | 970 | #endif | ||
978 | 971 | |||
979 | 972 | GBLDEF cache_rec_ptr_t pin_fail_cr; /* Pointer to the cache-record that we failed while pinning */ | ||
980 | 973 | GBLDEF cache_rec pin_fail_cr_contents; /* Contents of the cache-record that we failed while pinning */ | ||
981 | 974 | GBLDEF cache_rec_ptr_t pin_fail_twin_cr; /* Pointer to twin of the cache-record that we failed to pin */ | ||
982 | 975 | GBLDEF cache_rec pin_fail_twin_cr_contents; /* Contents of twin of the cache-record that we failed to pin */ | ||
983 | 976 | GBLDEF bt_rec_ptr_t pin_fail_bt; /* Pointer to bt of the cache-record that we failed to pin */ | ||
984 | 977 | GBLDEF bt_rec pin_fail_bt_contents; /* Contents of bt of the cache-record that we failed to pin */ | ||
985 | 978 | GBLDEF int4 pin_fail_in_crit; /* Holder of crit at the time we failed to pin */ | ||
986 | 979 | GBLDEF int4 pin_fail_wc_in_free; /* Number of write cache records in free queue when we failed to pin */ | ||
987 | 980 | GBLDEF int4 pin_fail_wcs_active_lvl; /* Number of entries in active queue when we failed to pin */ | ||
988 | 981 | GBLDEF int4 pin_fail_ref_cnt; /* Reference count when we failed to pin */ | ||
989 | 982 | GBLDEF int4 pin_fail_in_wtstart; /* Count of processes in wcs_wtstart when we failed to pin */ | ||
990 | 983 | GBLDEF int4 pin_fail_phase2_commit_pidcnt; /* Number of processes in phase2 commit when we failed to pin */ | ||
991 | 984 | |||
992 | 985 | #ifdef DEBUG | ||
993 | 986 | GBLDEF boolean_t gtm_gvundef_fatal; | ||
994 | 987 | GBLDEF boolean_t in_op_gvget; /* TRUE if op_gvget() is a call ancestor in the C-stack */ | ||
995 | 988 | GBLDEF boolean_t ready2signal_gvundef; /* TRUE if GET operation is about to signal a GVUNDEF */ | ||
996 | 989 | #endif | ||
997 | 990 | |||
998 | 991 | GBLDEF boolean_t gtm_tp_allocation_clue; /* block# hint to start allocation for created blocks in TP */ | ||
999 | 992 | |||
1000 | 993 | #ifdef UNIX | ||
1001 | 994 | GBLDEF int4 gtm_zlib_cmp_level; /* zlib compression level specified at process startup */ | ||
1002 | 995 | GBLDEF int4 repl_zlib_cmp_level; /* zlib compression level currently in use in replication pipe. | ||
1003 | 996 | * This is a source-server specific variable and is non-zero only | ||
1004 | 997 | * if compression is enabled and works in the receiver server as well. | ||
1005 | 998 | */ | ||
1006 | 999 | GBLDEF zlib_cmp_func_t zlib_compress_fnptr; | ||
1007 | 1000 | GBLDEF zlib_uncmp_func_t zlib_uncompress_fnptr; | ||
1008 | 1001 | #endif | ||
1009 | 1002 | |||
1010 | 1003 | GBLDEF mlk_stats_t mlk_stats; /* Process-private M-lock statistics */ | ||
1011 | 1004 | |||
1012 | 1005 | #ifdef UNIX | ||
1013 | 1006 | /* Initialized blockalrm and block_sigsent can be used by all */ | ||
1014 | 1007 | GBLDEF boolean_t blocksig_initialized = FALSE; /* set to TRUE when blockalrm and block_sigsent are initialized */ | ||
1015 | 1008 | GBLDEF sigset_t blockalrm; | ||
1016 | 1009 | GBLDEF sigset_t block_sigsent; /* block all signals that can be sent externally | ||
1017 | 1010 | (SIGINT, SIGQUIT, SIGTERM, SIGTSTP, SIGCONT) */ | ||
1018 | 1011 | #endif | ||
1019 | 1012 | |||
1020 | 0 | 1013 | ||
1021 | === added file 'src/gtm/sr_port/gtm_env_init.c' | |||
1022 | --- src/gtm/sr_port/gtm_env_init.c 1970-01-01 00:00:00 +0000 | |||
1023 | +++ src/gtm/sr_port/gtm_env_init.c 2009-04-07 01:13:36 +0000 | |||
1024 | @@ -0,0 +1,216 @@ | |||
1025 | 1 | /**************************************************************** | ||
1026 | 2 | * * | ||
1027 | 3 | * Copyright 2004, 2008 Fidelity Information Services, Inc * | ||
1028 | 4 | * * | ||
1029 | 5 | * This source code contains the intellectual property * | ||
1030 | 6 | * of its copyright holder(s), and is made available * | ||
1031 | 7 | * under a license. If you do not know the terms of * | ||
1032 | 8 | * the license, please stop and do not read further. * | ||
1033 | 9 | * * | ||
1034 | 10 | ****************************************************************/ | ||
1035 | 11 | |||
1036 | 12 | #include "mdef.h" | ||
1037 | 13 | |||
1038 | 14 | #include "gtm_logicals.h" | ||
1039 | 15 | #include "gtm_stdlib.h" | ||
1040 | 16 | #include "gtm_string.h" | ||
1041 | 17 | #include "logical_truth_value.h" | ||
1042 | 18 | #include "trans_numeric.h" | ||
1043 | 19 | #include "gtmdbglvl.h" | ||
1044 | 20 | #include "iosp.h" | ||
1045 | 21 | #include "wbox_test_init.h" | ||
1046 | 22 | #include "gtm_env_init.h" /* for gtm_env_init() and gtm_env_init_sp() prototype */ | ||
1047 | 23 | #include "gt_timer.h" | ||
1048 | 24 | #include "io.h" | ||
1049 | 25 | #include "iotcpdef.h" | ||
1050 | 26 | #include "iosocketdef.h" | ||
1051 | 27 | #include "gtm_malloc.h" | ||
1052 | 28 | #include "cache.h" | ||
1053 | 29 | #include "gdsroot.h" /* needed for gdsfhead.h */ | ||
1054 | 30 | #include "gdskill.h" /* needed for gdsfhead.h */ | ||
1055 | 31 | #include "gdsbt.h" /* needed for gdsfhead.h */ | ||
1056 | 32 | #include "gdsfhead.h" /* needed for MAXTOTALBLKS_MAX macro */ | ||
1057 | 33 | #include "trans_log_name.h" | ||
1058 | 34 | #include "op.h" | ||
1059 | 35 | #include "svnames.h" | ||
1060 | 36 | |||
1061 | 37 | #ifdef DEBUG | ||
1062 | 38 | # define INITIAL_DEBUG_LEVEL GDL_Simple | ||
1063 | 39 | GBLDEF boolean_t gtmdbglvl_inited; /* gtmDebugLevel has been initialized */ | ||
1064 | 40 | #else | ||
1065 | 41 | # define INITIAL_DEBUG_LEVEL GDL_None | ||
1066 | 42 | #endif | ||
1067 | 43 | |||
1068 | 44 | #ifdef FULLBLOCKWRITES | ||
1069 | 45 | # define DEFAULT_FBW_FLAG TRUE | ||
1070 | 46 | #else | ||
1071 | 47 | # define DEFAULT_FBW_FLAG FALSE | ||
1072 | 48 | #endif | ||
1073 | 49 | |||
1074 | 50 | GBLREF boolean_t dollar_zquit_anyway; /* if TRUE compile QUITs to not care whether or not they're from an extrinsic */ | ||
1075 | 51 | GBLREF boolean_t gvdupsetnoop; /* if TRUE, duplicate SETs update journal but not database (except | ||
1076 | 52 | for curr_tn++) */ | ||
1077 | 53 | GBLREF uint4 gtmDebugLevel; /* Debug level (0 = using default sm module so with | ||
1078 | 54 | a DEBUG build, even level 0 implies basic debugging) */ | ||
1079 | 55 | GBLREF boolean_t gtm_fullblockwrites; /* Do full (not partial) database block writes T/F */ | ||
1080 | 56 | GBLREF boolean_t certify_all_blocks; | ||
1081 | 57 | GBLREF boolean_t local_collseq_stdnull; /* If true, standard null subscript collation will be used for local variables */ | ||
1082 | 58 | GBLREF uint4 gtm_blkupgrade_flag; /* controls whether dynamic block upgrade is attempted or not */ | ||
1083 | 59 | GBLREF boolean_t gtm_dbfilext_syslog_disable; /* control whether db file extension message is logged or not */ | ||
1084 | 60 | GBLREF uint4 gtm_max_sockets; /* Maximum sockets in a socket device that can be created by this process */ | ||
1085 | 61 | GBLREF bool undef_inhibit; | ||
1086 | 62 | GBLREF uint4 outOfMemoryMitigateSize; /* Reserve that we will freed to help cleanup if run out of memory */ | ||
1087 | 63 | GBLREF uint4 max_cache_memsize; /* Maximum bytes used for indirect cache object code */ | ||
1088 | 64 | GBLREF uint4 max_cache_entries; /* Maximum number of cached indirect compilations */ | ||
1089 | 65 | GBLREF boolean_t gtm_tp_allocation_clue; /* block# hint to start allocation for created blocks in TP */ | ||
1090 | 66 | |||
1091 | 67 | GBLREF char prombuf[MAX_MIDENT_LEN]; | ||
1092 | 68 | GBLREF mstr gtmprompt; | ||
1093 | 69 | |||
1094 | 70 | #ifdef DEBUG | ||
1095 | 71 | GBLREF boolean_t gtm_gvundef_fatal; | ||
1096 | 72 | #endif | ||
1097 | 73 | |||
1098 | 74 | void gtm_env_init(void) | ||
1099 | 75 | { | ||
1100 | 76 | static boolean_t gtm_env_init_done = FALSE; | ||
1101 | 77 | mstr val; | ||
1102 | 78 | boolean_t ret, is_defined; | ||
1103 | 79 | uint4 tdbglvl, tmsock, reservesize, memsize, cachent; | ||
1104 | 80 | char* prompt_env_val; | ||
1105 | 81 | |||
1106 | 82 | if (!gtm_env_init_done) | ||
1107 | 83 | { | ||
1108 | 84 | /* See if a debug level has been specified. Do this first since gtmDebugLevel needs | ||
1109 | 85 | to be initialized before any mallocs are done in the system. | ||
1110 | 86 | */ | ||
1111 | 87 | gtmDebugLevel = INITIAL_DEBUG_LEVEL; | ||
1112 | 88 | val.addr = GTM_DEBUG_LEVEL_ENVLOG; | ||
1113 | 89 | val.len = sizeof(GTM_DEBUG_LEVEL_ENVLOG) - 1; | ||
1114 | 90 | if (tdbglvl = trans_numeric(&val, &is_defined, TRUE)) /* Note assignment!! */ | ||
1115 | 91 | { /* Some kind of debugging was asked for.. */ | ||
1116 | 92 | tdbglvl |= GDL_Simple; /* Make sure simple debugging turned on if any is */ | ||
1117 | 93 | if ((GDL_SmChkFreeBackfill | GDL_SmChkAllocBackfill) & tdbglvl) | ||
1118 | 94 | tdbglvl |= GDL_SmBackfill; /* Can't check it unless it's filled in */ | ||
1119 | 95 | if (GDL_SmStorHog & tdbglvl) | ||
1120 | 96 | tdbglvl |= GDL_SmBackfill | GDL_SmChkAllocBackfill; | ||
1121 | 97 | gtmDebugLevel |= tdbglvl; | ||
1122 | 98 | } | ||
1123 | 99 | DEBUG_ONLY(gtmdbglvl_inited = TRUE); | ||
1124 | 100 | |||
1125 | 101 | /* Duplicate Set Noop environment/logical */ | ||
1126 | 102 | val.addr = GTM_GVDUPSETNOOP; | ||
1127 | 103 | val.len = sizeof(GTM_GVDUPSETNOOP) - 1; | ||
1128 | 104 | assert(FALSE == gvdupsetnoop); /* should have been set to FALSE in gbldefs.c */ | ||
1129 | 105 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1130 | 106 | if (is_defined) | ||
1131 | 107 | gvdupsetnoop = ret; /* if the logical is not defined, we want gvdupsetnoop to take its default value */ | ||
1132 | 108 | |||
1133 | 109 | /* NOUNDEF environment/logical */ | ||
1134 | 110 | val.addr = GTM_NOUNDEF; | ||
1135 | 111 | val.len = sizeof(GTM_NOUNDEF) - 1; | ||
1136 | 112 | assert(FALSE == undef_inhibit); /* should have been set to FALSE at global variable definition time */ | ||
1137 | 113 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1138 | 114 | if (is_defined) | ||
1139 | 115 | undef_inhibit = ret; /* if the logical is not defined, we want undef_inhibit to take its default value */ | ||
1140 | 116 | |||
1141 | 117 | # ifdef DEBUG | ||
1142 | 118 | /* GTM_GVUNDEF_FATAL environment/logical */ | ||
1143 | 119 | val.addr = GTM_GVUNDEF_FATAL; | ||
1144 | 120 | val.len = sizeof(GTM_GVUNDEF_FATAL) - 1; | ||
1145 | 121 | assert(FALSE == gtm_gvundef_fatal); /* should have been set to FALSE in gbldefs.c */ | ||
1146 | 122 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1147 | 123 | if (is_defined) | ||
1148 | 124 | gtm_gvundef_fatal = ret; /* if logical is not defined, we want gtm_gvundef_fatal to take default value */ | ||
1149 | 125 | # endif | ||
1150 | 126 | |||
1151 | 127 | /* Initialize variable that controls TP allocation clue (for created blocks) */ | ||
1152 | 128 | val.addr = GTM_TP_ALLOCATION_CLUE; | ||
1153 | 129 | val.len = sizeof(GTM_TP_ALLOCATION_CLUE) - 1; | ||
1154 | 130 | gtm_tp_allocation_clue = trans_numeric(&val, &is_defined, TRUE); | ||
1155 | 131 | if (!is_defined) | ||
1156 | 132 | gtm_tp_allocation_clue = MAXTOTALBLKS_MAX; | ||
1157 | 133 | |||
1158 | 134 | /* Full Database-block Write mode */ | ||
1159 | 135 | val.addr = GTM_FULLBLOCKWRITES; | ||
1160 | 136 | val.len = sizeof(GTM_FULLBLOCKWRITES) - 1; | ||
1161 | 137 | gtm_fullblockwrites = logical_truth_value(&val, FALSE, &is_defined); | ||
1162 | 138 | if (!is_defined) | ||
1163 | 139 | gtm_fullblockwrites = DEFAULT_FBW_FLAG; | ||
1164 | 140 | |||
1165 | 141 | /* GDS Block certification */ | ||
1166 | 142 | val.addr = GTM_GDSCERT; | ||
1167 | 143 | val.len = sizeof(GTM_GDSCERT) - 1; | ||
1168 | 144 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1169 | 145 | if (is_defined) | ||
1170 | 146 | certify_all_blocks = ret; /* if the logical is not defined, we want to take default value */ | ||
1171 | 147 | |||
1172 | 148 | /* Initialize null subscript's collation order */ | ||
1173 | 149 | val.addr = LCT_STDNULL; | ||
1174 | 150 | val.len = sizeof(LCT_STDNULL) - 1; | ||
1175 | 151 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1176 | 152 | if (is_defined) | ||
1177 | 153 | local_collseq_stdnull = ret; | ||
1178 | 154 | |||
1179 | 155 | /* Initialize variables for white box testing. Even though these white-box test variables only control the | ||
1180 | 156 | * flow of the DBG builds, the PRO builds check on these variables (for example, in tp_restart.c to decide | ||
1181 | 157 | * whether to fork_n_core or not) so need to do this initialization for PRO builds as well. | ||
1182 | 158 | */ | ||
1183 | 159 | wbox_test_init(); | ||
1184 | 160 | |||
1185 | 161 | /* Initialize variable that controls dynamic GT.M block upgrade */ | ||
1186 | 162 | val.addr = GTM_BLKUPGRADE_FLAG; | ||
1187 | 163 | val.len = sizeof(GTM_BLKUPGRADE_FLAG) - 1; | ||
1188 | 164 | gtm_blkupgrade_flag = trans_numeric(&val, &is_defined, TRUE); | ||
1189 | 165 | |||
1190 | 166 | /* Initialize whether database file extensions need to be logged in the operator log */ | ||
1191 | 167 | val.addr = GTM_DBFILEXT_SYSLOG_DISABLE; | ||
1192 | 168 | val.len = sizeof(GTM_DBFILEXT_SYSLOG_DISABLE) - 1; | ||
1193 | 169 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1194 | 170 | if (is_defined) | ||
1195 | 171 | gtm_dbfilext_syslog_disable = ret; /* if the logical is not defined, we want to take default value */ | ||
1196 | 172 | |||
1197 | 173 | /* Initialize maximum sockets in a single socket device createable by this process */ | ||
1198 | 174 | gtm_max_sockets = MAX_N_SOCKET; | ||
1199 | 175 | val.addr = GTM_MAX_SOCKETS; | ||
1200 | 176 | val.len = sizeof(GTM_MAX_SOCKETS) - 1; | ||
1201 | 177 | if ((tmsock = trans_numeric(&val, &is_defined, TRUE)) && MAX_MAX_N_SOCKET > tmsock) /* Note assignment!! */ | ||
1202 | 178 | gtm_max_sockets = tmsock; | ||
1203 | 179 | |||
1204 | 180 | /* Initialize storage to allocate and keep in our back pocket in case run out of memory */ | ||
1205 | 181 | outOfMemoryMitigateSize = GTM_MEMORY_RESERVE_DEFAULT; | ||
1206 | 182 | val.addr = GTM_MEMORY_RESERVE; | ||
1207 | 183 | val.len = sizeof(GTM_MEMORY_RESERVE) - 1; | ||
1208 | 184 | if (reservesize = trans_numeric(&val, &is_defined, TRUE)) /* Note assignment!! */ | ||
1209 | 185 | outOfMemoryMitigateSize = reservesize; | ||
1210 | 186 | |||
1211 | 187 | /* Initialize indirect cache limits (max memory, max entries) */ | ||
1212 | 188 | max_cache_memsize = MAX_CACHE_MEMSIZE * 1024; | ||
1213 | 189 | val.addr = GTM_MAX_INDRCACHE_MEMORY; | ||
1214 | 190 | val.len = sizeof(GTM_MAX_INDRCACHE_MEMORY) - 1; | ||
1215 | 191 | if (memsize = trans_numeric(&val, &is_defined, TRUE)) /* Note assignment!! */ | ||
1216 | 192 | max_cache_memsize = memsize * 1024; | ||
1217 | 193 | max_cache_entries = MAX_CACHE_ENTRIES; | ||
1218 | 194 | val.addr = GTM_MAX_INDRCACHE_COUNT; | ||
1219 | 195 | val.len = sizeof(GTM_MAX_INDRCACHE_COUNT) - 1; | ||
1220 | 196 | if (cachent = trans_numeric(&val, &is_defined, TRUE)) /* Note assignment!! */ | ||
1221 | 197 | max_cache_entries = cachent; | ||
1222 | 198 | |||
1223 | 199 | /* Initialize ZQUIT to control funky QUIT compilation */ | ||
1224 | 200 | val.addr = GTM_ZQUIT_ANYWAY; | ||
1225 | 201 | val.len = sizeof(GTM_ZQUIT_ANYWAY) - 1; | ||
1226 | 202 | ret = logical_truth_value(&val, FALSE, &is_defined); | ||
1227 | 203 | if (is_defined) | ||
1228 | 204 | dollar_zquit_anyway = ret; | ||
1229 | 205 | |||
1230 | 206 | if (NULL!=(prompt_env_val=GETENV(GTM_PROMPT+1)) && strlen(prompt_env_val)<sizeof(prombuf)) { | ||
1231 | 207 | val.addr = GTM_PROMPT; | ||
1232 | 208 | val.len = sizeof(GTM_PROMPT) - 1; | ||
1233 | 209 | TRANS_LOG_NAME(&val, >mprompt, prombuf, sizeof(prombuf), do_sendmsg_on_log2long); | ||
1234 | 210 | } | ||
1235 | 211 | |||
1236 | 212 | /* Platform specific initializations */ | ||
1237 | 213 | gtm_env_init_sp(); | ||
1238 | 214 | gtm_env_init_done = TRUE; | ||
1239 | 215 | } | ||
1240 | 216 | } | ||
1241 | 0 | 217 | ||
1242 | === added file 'src/gtm/sr_port/op_svput.c' | |||
1243 | --- src/gtm/sr_port/op_svput.c 1970-01-01 00:00:00 +0000 | |||
1244 | +++ src/gtm/sr_port/op_svput.c 2009-04-07 01:13:36 +0000 | |||
1245 | @@ -0,0 +1,314 @@ | |||
1246 | 1 | /**************************************************************** | ||
1247 | 2 | * * | ||
1248 | 3 | * Copyright 2001, 2008 Fidelity Information Services, Inc * | ||
1249 | 4 | * * | ||
1250 | 5 | * This source code contains the intellectual property * | ||
1251 | 6 | * of its copyright holder(s), and is made available * | ||
1252 | 7 | * under a license. If you do not know the terms of * | ||
1253 | 8 | * the license, please stop and do not read further. * | ||
1254 | 9 | * * | ||
1255 | 10 | ****************************************************************/ | ||
1256 | 11 | |||
1257 | 12 | #include "mdef.h" | ||
1258 | 13 | |||
1259 | 14 | #include "gtm_stdlib.h" | ||
1260 | 15 | #include "gtm_string.h" | ||
1261 | 16 | |||
1262 | 17 | #include "svnames.h" | ||
1263 | 18 | #include "io.h" | ||
1264 | 19 | #include "gdsroot.h" | ||
1265 | 20 | #include "gtm_facility.h" | ||
1266 | 21 | #include "fileinfo.h" | ||
1267 | 22 | #include "gdsbt.h" | ||
1268 | 23 | #include "gdsfhead.h" | ||
1269 | 24 | #include "indir_enum.h" | ||
1270 | 25 | #include "error.h" | ||
1271 | 26 | #include "stringpool.h" | ||
1272 | 27 | #include "op.h" | ||
1273 | 28 | #include "mvalconv.h" | ||
1274 | 29 | #include "zroutines.h" | ||
1275 | 30 | #include "dpgbldir.h" | ||
1276 | 31 | #include "dpgbldir_sysops.h" | ||
1277 | 32 | #include "gtmmsg.h" | ||
1278 | 33 | #include "ztrap_save_ctxt.h" | ||
1279 | 34 | #include "dollar_zlevel.h" | ||
1280 | 35 | #include "error_trap.h" | ||
1281 | 36 | #include "gtm_ctype.h" | ||
1282 | 37 | #include "setzdir.h" | ||
1283 | 38 | #include "rtnhdr.h" | ||
1284 | 39 | #include "stack_frame.h" | ||
1285 | 40 | #include "getzdir.h" | ||
1286 | 41 | #include "gtm_newintrinsic.h" | ||
1287 | 42 | |||
1288 | 43 | GBLREF char prombuf[MAX_MIDENT_LEN]; | ||
1289 | 44 | GBLREF mstr gtmprompt; | ||
1290 | 45 | |||
1291 | 46 | GBLREF gv_key *gv_currkey; | ||
1292 | 47 | GBLREF gv_namehead *gv_target; | ||
1293 | 48 | GBLREF gd_addr *gd_header; | ||
1294 | 49 | GBLREF gd_addr *gd_targ_addr; | ||
1295 | 50 | GBLREF gd_binding *gd_map; | ||
1296 | 51 | GBLREF gd_binding *gd_map_top; | ||
1297 | 52 | GBLREF io_pair io_curr_device; | ||
1298 | 53 | GBLREF mval dollar_ztrap; | ||
1299 | 54 | GBLREF mval dollar_zstatus; | ||
1300 | 55 | GBLREF mval dollar_zgbldir; | ||
1301 | 56 | GBLREF mval dollar_zstep; | ||
1302 | 57 | GBLREF mstr dollar_zcompile; | ||
1303 | 58 | GBLREF mstr dollar_zroutines; | ||
1304 | 59 | GBLREF mstr dollar_zsource; | ||
1305 | 60 | GBLREF int dollar_zmaxtptime; | ||
1306 | 61 | GBLREF int ztrap_form; | ||
1307 | 62 | GBLREF mval dollar_etrap; | ||
1308 | 63 | GBLREF mval dollar_zerror; | ||
1309 | 64 | GBLREF mval dollar_zyerror; | ||
1310 | 65 | GBLREF mval dollar_system; | ||
1311 | 66 | GBLREF mval dollar_zinterrupt; | ||
1312 | 67 | GBLREF boolean_t ztrap_new; | ||
1313 | 68 | GBLREF stack_frame *error_frame; | ||
1314 | 69 | GBLREF boolean_t ztrap_explicit_null; /* whether $ZTRAP was explicitly set to NULL in this frame */ | ||
1315 | 70 | GBLREF int4 zdate_form; | ||
1316 | 71 | GBLREF mval dollar_ztexit; | ||
1317 | 72 | GBLREF boolean_t dollar_ztexit_bool; | ||
1318 | 73 | GBLREF boolean_t dollar_zquit_anyway; | ||
1319 | 74 | |||
1320 | 75 | void op_svput(int varnum, mval *v) | ||
1321 | 76 | { | ||
1322 | 77 | int i, ok, state; | ||
1323 | 78 | char *vptr; | ||
1324 | 79 | error_def(ERR_INVECODEVAL); | ||
1325 | 80 | error_def(ERR_SETECODE); | ||
1326 | 81 | error_def(ERR_SYSTEMVALUE); | ||
1327 | 82 | |||
1328 | 83 | switch (varnum) | ||
1329 | 84 | { | ||
1330 | 85 | case SV_X: | ||
1331 | 86 | MV_FORCE_NUM(v); | ||
1332 | 87 | io_curr_device.out->dollar.x = (short)MV_FORCE_INT(v); | ||
1333 | 88 | if ((short)(io_curr_device.out->dollar.x) < 0) | ||
1334 | 89 | io_curr_device.out->dollar.x = 0; | ||
1335 | 90 | break; | ||
1336 | 91 | case SV_Y: | ||
1337 | 92 | MV_FORCE_NUM(v); | ||
1338 | 93 | io_curr_device.out->dollar.y = (short)MV_FORCE_INT(v); | ||
1339 | 94 | if ((short)(io_curr_device.out->dollar.y) < 0) | ||
1340 | 95 | io_curr_device.out->dollar.y = 0; | ||
1341 | 96 | break; | ||
1342 | 97 | case SV_ZCOMPILE: | ||
1343 | 98 | MV_FORCE_STR(v); | ||
1344 | 99 | if (dollar_zcompile.addr) | ||
1345 | 100 | free (dollar_zcompile.addr); | ||
1346 | 101 | dollar_zcompile.addr = (char *)malloc(v->str.len); | ||
1347 | 102 | memcpy (dollar_zcompile.addr, v->str.addr, v->str.len); | ||
1348 | 103 | dollar_zcompile.len = v->str.len; | ||
1349 | 104 | break; | ||
1350 | 105 | case SV_ZSTEP: | ||
1351 | 106 | MV_FORCE_STR(v); | ||
1352 | 107 | op_commarg(v,indir_linetail); | ||
1353 | 108 | op_unwind(); | ||
1354 | 109 | dollar_zstep = *v; | ||
1355 | 110 | break; | ||
1356 | 111 | case SV_ZGBLDIR: | ||
1357 | 112 | MV_FORCE_STR(v); | ||
1358 | 113 | if ((dollar_zgbldir.str.len != v->str.len) || memcmp(dollar_zgbldir.str.addr, v->str.addr, dollar_zgbldir.str.len)) | ||
1359 | 114 | { | ||
1360 | 115 | if (0 == v->str.len) | ||
1361 | 116 | { | ||
1362 | 117 | /* set $zgbldir="" */ | ||
1363 | 118 | dpzgbini(); | ||
1364 | 119 | gd_header = NULL; | ||
1365 | 120 | } else | ||
1366 | 121 | { | ||
1367 | 122 | gd_header = zgbldir(v); | ||
1368 | 123 | /* update the gd_map */ | ||
1369 | 124 | SET_GD_MAP; | ||
1370 | 125 | dollar_zgbldir.str.len = v->str.len; | ||
1371 | 126 | dollar_zgbldir.str.addr = v->str.addr; | ||
1372 | 127 | s2pool(&dollar_zgbldir.str); | ||
1373 | 128 | } | ||
1374 | 129 | if (NULL != gv_currkey) | ||
1375 | 130 | { | ||
1376 | 131 | gv_currkey->base[0] = '\0'; | ||
1377 | 132 | gv_currkey->prev = gv_currkey->end = 0; | ||
1378 | 133 | } else if (NULL != gd_header) | ||
1379 | 134 | gvinit(); | ||
1380 | 135 | if (NULL != gv_target) | ||
1381 | 136 | gv_target->clue.end = 0; | ||
1382 | 137 | } | ||
1383 | 138 | break; | ||
1384 | 139 | case SV_ZMAXTPTIME: | ||
1385 | 140 | dollar_zmaxtptime = mval2i(v); | ||
1386 | 141 | break; | ||
1387 | 142 | case SV_ZROUTINES: | ||
1388 | 143 | MV_FORCE_STR(v); | ||
1389 | 144 | /* The string(v) should be parsed and loaded before setting $zroutines | ||
1390 | 145 | * to retain the old value in case errors occur while loading */ | ||
1391 | 146 | zro_load(&v->str); | ||
1392 | 147 | if (dollar_zroutines.addr) | ||
1393 | 148 | free (dollar_zroutines.addr); | ||
1394 | 149 | dollar_zroutines.addr = (char *)malloc(v->str.len); | ||
1395 | 150 | memcpy (dollar_zroutines.addr, v->str.addr, v->str.len); | ||
1396 | 151 | dollar_zroutines.len = v->str.len; | ||
1397 | 152 | break; | ||
1398 | 153 | case SV_ZSOURCE: | ||
1399 | 154 | MV_FORCE_STR(v); | ||
1400 | 155 | dollar_zsource = v->str; | ||
1401 | 156 | break; | ||
1402 | 157 | case SV_ZTRAP: | ||
1403 | 158 | MV_FORCE_STR(v); | ||
1404 | 159 | if (ztrap_new) | ||
1405 | 160 | op_newintrinsic(SV_ZTRAP); | ||
1406 | 161 | dollar_ztrap.mvtype = MV_STR; | ||
1407 | 162 | dollar_ztrap.str = v->str; | ||
1408 | 163 | /* Setting either $ZTRAP or $ETRAP to empty causes any current error trapping to be canceled */ | ||
1409 | 164 | if (!v->str.len) | ||
1410 | 165 | { | ||
1411 | 166 | dollar_etrap.mvtype = MV_STR; | ||
1412 | 167 | dollar_etrap.str = v->str; | ||
1413 | 168 | ztrap_explicit_null = TRUE; | ||
1414 | 169 | } else /* Ensure that $ETRAP and $ZTRAP are not both active at the same time */ | ||
1415 | 170 | { | ||
1416 | 171 | ztrap_explicit_null = FALSE; | ||
1417 | 172 | if (dollar_etrap.str.len > 0) | ||
1418 | 173 | gtm_newintrinsic(&dollar_etrap); | ||
1419 | 174 | } | ||
1420 | 175 | if (ztrap_form & ZTRAP_POP) | ||
1421 | 176 | ztrap_save_ctxt(); | ||
1422 | 177 | break; | ||
1423 | 178 | case SV_ZSTATUS: | ||
1424 | 179 | MV_FORCE_STR(v); | ||
1425 | 180 | dollar_zstatus.mvtype = MV_STR; | ||
1426 | 181 | dollar_zstatus.str = v->str; | ||
1427 | 182 | break; | ||
1428 | 183 | case SV_PROMPT: | ||
1429 | 184 | MV_FORCE_STR(v); | ||
1430 | 185 | MV_FORCE_LEN_STRICT(v); /* Ensure that direct mode prompt will not have BADCHARs, | ||
1431 | 186 | otherwise the BADCHAR error may fill up the filesystem */ | ||
1432 | 187 | if (v->str.len <= sizeof(prombuf)) | ||
1433 | 188 | gtmprompt.len = v->str.len; | ||
1434 | 189 | else if (!gtm_utf8_mode) | ||
1435 | 190 | gtmprompt.len = sizeof(prombuf); | ||
1436 | 191 | #ifdef UNICODE_SUPPORTED | ||
1437 | 192 | else | ||
1438 | 193 | { | ||
1439 | 194 | UTF8_LEADING_BYTE(v->str.addr + sizeof(prombuf), v->str.addr, vptr); | ||
1440 | 195 | gtmprompt.len = INTCAST(vptr - v->str.addr); | ||
1441 | 196 | } | ||
1442 | 197 | #endif | ||
1443 | 198 | memcpy(gtmprompt.addr, v->str.addr, gtmprompt.len); | ||
1444 | 199 | break; | ||
1445 | 200 | case SV_ECODE: | ||
1446 | 201 | MV_FORCE_STR(v); | ||
1447 | 202 | if (v->str.len) | ||
1448 | 203 | { | ||
1449 | 204 | /* Format must be like ,Mnnn,Mnnn,Zxxx,Uxxx, | ||
1450 | 205 | * Mnnn are ANSI standard error codes | ||
1451 | 206 | * Zxxx are implementation-specific codes | ||
1452 | 207 | * Uxxx are end-user defined codes | ||
1453 | 208 | * Note that there must be commas at the start and at the end | ||
1454 | 209 | */ | ||
1455 | 210 | for (state = 2, i = 0; (i < v->str.len) && (state <= 2); i++) | ||
1456 | 211 | { | ||
1457 | 212 | switch(state) | ||
1458 | 213 | { | ||
1459 | 214 | case 2: state = (v->str.addr[i] == ',') ? 1 : 101; | ||
1460 | 215 | break; | ||
1461 | 216 | case 1: state = ((v->str.addr[i] == 'M') || | ||
1462 | 217 | (v->str.addr[i] == 'U') || | ||
1463 | 218 | (v->str.addr[i] == 'Z')) ? 0 : 101; | ||
1464 | 219 | break; | ||
1465 | 220 | case 0: state = (v->str.addr[i] == ',') ? 1 : 0; | ||
1466 | 221 | break; | ||
1467 | 222 | } | ||
1468 | 223 | } | ||
1469 | 224 | /* The above check would pass strings like "," | ||
1470 | 225 | * so double-check that there are at least three characters | ||
1471 | 226 | * (starting comma, ending comma, and something in between) | ||
1472 | 227 | */ | ||
1473 | 228 | if ((state != 1) || (v->str.len < 3)) | ||
1474 | 229 | { | ||
1475 | 230 | /* error, ecode = M101 */ | ||
1476 | 231 | rts_error(VARLSTCNT(4) ERR_INVECODEVAL, 2, v->str.len, v->str.addr); | ||
1477 | 232 | } | ||
1478 | 233 | } | ||
1479 | 234 | if (v->str.len > 0) | ||
1480 | 235 | { | ||
1481 | 236 | ecode_add(&v->str); | ||
1482 | 237 | rts_error(VARLSTCNT(2) ERR_SETECODE, 0); | ||
1483 | 238 | } else | ||
1484 | 239 | { | ||
1485 | 240 | NULLIFY_DOLLAR_ECODE; /* reset $ECODE related variables to correspond to $ECODE = NULL state */ | ||
1486 | 241 | NULLIFY_ERROR_FRAME; /* we are no more in error-handling mode */ | ||
1487 | 242 | } | ||
1488 | 243 | break; | ||
1489 | 244 | case SV_ETRAP: | ||
1490 | 245 | MV_FORCE_STR(v); | ||
1491 | 246 | dollar_etrap.mvtype = MV_STR; | ||
1492 | 247 | dollar_etrap.str = v->str; | ||
1493 | 248 | /* Setting either $ZTRAP or $ETRAP to empty causes any current error trapping to be canceled */ | ||
1494 | 249 | if (!v->str.len) | ||
1495 | 250 | { | ||
1496 | 251 | dollar_ztrap.mvtype = MV_STR; | ||
1497 | 252 | dollar_ztrap.str = v->str; | ||
1498 | 253 | } else if (dollar_ztrap.str.len > 0) | ||
1499 | 254 | { /* Ensure that $ETRAP and $ZTRAP are not both active at the same time */ | ||
1500 | 255 | assert(FALSE == ztrap_explicit_null); | ||
1501 | 256 | gtm_newintrinsic(&dollar_ztrap); | ||
1502 | 257 | } | ||
1503 | 258 | ztrap_explicit_null = FALSE; | ||
1504 | 259 | break; | ||
1505 | 260 | case SV_ZERROR: | ||
1506 | 261 | MV_FORCE_STR(v); | ||
1507 | 262 | dollar_zerror.mvtype = MV_STR; | ||
1508 | 263 | dollar_zerror.str = v->str; | ||
1509 | 264 | break; | ||
1510 | 265 | case SV_ZYERROR: | ||
1511 | 266 | MV_FORCE_STR(v); | ||
1512 | 267 | dollar_zyerror.mvtype = MV_STR; | ||
1513 | 268 | dollar_zyerror.str = v->str; | ||
1514 | 269 | break; | ||
1515 | 270 | case SV_SYSTEM: | ||
1516 | 271 | ok = 1; | ||
1517 | 272 | if (!(v->mvtype & MV_STR)) | ||
1518 | 273 | ok = 0; | ||
1519 | 274 | if (ok && v->str.addr[0] != '4') | ||
1520 | 275 | ok = 0; | ||
1521 | 276 | if (ok && v->str.addr[1] != '7') | ||
1522 | 277 | ok = 0; | ||
1523 | 278 | if ((' ' != v->str.addr[2]) && !ispunct(v->str.addr[2])) | ||
1524 | 279 | ok = 0; | ||
1525 | 280 | if (ok) | ||
1526 | 281 | dollar_system.str = v->str; | ||
1527 | 282 | else | ||
1528 | 283 | rts_error(VARLSTCNT(4) ERR_SYSTEMVALUE, 2, v->str.len, v->str.addr); | ||
1529 | 284 | break; | ||
1530 | 285 | case SV_ZDIR: | ||
1531 | 286 | setzdir(v, NULL); /* change directory to v */ | ||
1532 | 287 | getzdir(); /* update dollar_zdir with current working directory */ | ||
1533 | 288 | break; | ||
1534 | 289 | case SV_ZINTERRUPT: | ||
1535 | 290 | MV_FORCE_STR(v); | ||
1536 | 291 | dollar_zinterrupt.mvtype = MV_STR; | ||
1537 | 292 | dollar_zinterrupt.str = v->str; | ||
1538 | 293 | break; | ||
1539 | 294 | case SV_ZDATE_FORM: | ||
1540 | 295 | MV_FORCE_NUM(v); | ||
1541 | 296 | zdate_form = (short)MV_FORCE_INT(v); | ||
1542 | 297 | break; | ||
1543 | 298 | case SV_ZTEXIT: | ||
1544 | 299 | MV_FORCE_STR(v); | ||
1545 | 300 | dollar_ztexit.mvtype = MV_STR; | ||
1546 | 301 | dollar_ztexit.str = v->str; | ||
1547 | 302 | /* Coercing $ZTEXIT to boolean at SET command is more efficient than coercing before each | ||
1548 | 303 | * rethrow at TR/TRO. Since we want to maintain dollar_ztexit as a string, coercion should | ||
1549 | 304 | * not be performed on dollar_ztext, but on a temporary (i.e. parameter v) */ | ||
1550 | 305 | dollar_ztexit_bool = MV_FORCE_BOOL(v); | ||
1551 | 306 | break; | ||
1552 | 307 | case SV_ZQUIT: | ||
1553 | 308 | dollar_zquit_anyway = MV_FORCE_BOOL(v); | ||
1554 | 309 | break; | ||
1555 | 310 | default: | ||
1556 | 311 | GTMASSERT; | ||
1557 | 312 | } | ||
1558 | 313 | return; | ||
1559 | 314 | } | ||
1560 | 0 | 315 | ||
1561 | === added directory 'src/gtm/sr_unix' | |||
1562 | === added file 'src/gtm/sr_unix/gtm_logicals.h' | |||
1563 | --- src/gtm/sr_unix/gtm_logicals.h 1970-01-01 00:00:00 +0000 | |||
1564 | +++ src/gtm/sr_unix/gtm_logicals.h 2009-02-13 06:21:27 +0000 | |||
1565 | @@ -0,0 +1,94 @@ | |||
1566 | 1 | /**************************************************************** | ||
1567 | 2 | * * | ||
1568 | 3 | * Copyright 2001, 2008 Fidelity Information Services, Inc * | ||
1569 | 4 | * * | ||
1570 | 5 | * This source code contains the intellectual property * | ||
1571 | 6 | * of its copyright holder(s), and is made available * | ||
1572 | 7 | * under a license. If you do not know the terms of * | ||
1573 | 8 | * the license, please stop and do not read further. * | ||
1574 | 9 | * * | ||
1575 | 10 | ****************************************************************/ | ||
1576 | 11 | |||
1577 | 12 | /* gtm_logicals.h - Environment variables used by GT.M. */ | ||
1578 | 13 | |||
1579 | 14 | /* -------------------------- Common to Unix and VMS -------------------------- */ | ||
1580 | 15 | |||
1581 | 16 | #define GTM_DIST_LOG "$gtm_dist" | ||
1582 | 17 | |||
1583 | 18 | /* Database */ | ||
1584 | 19 | #define GTM_GBLDIR "$gtmgbldir" | ||
1585 | 20 | #define GTM_ENV_XLATE "$gtm_env_translate" | ||
1586 | 21 | #define GTM_GVDUPSETNOOP "$gtm_gvdupsetnoop" | ||
1587 | 22 | #define GTM_GVUNDEF_FATAL "$gtm_gvundef_fatal" | ||
1588 | 23 | #define GTM_GDSCERT "$gtm_gdscert" | ||
1589 | 24 | #define GTM_BLKUPGRADE_FLAG "$gtm_blkupgrade_flag" | ||
1590 | 25 | #define GTM_DBFILEXT_SYSLOG_DISABLE "$gtm_dbfilext_syslog_disable" | ||
1591 | 26 | #define GTM_TP_ALLOCATION_CLUE "$gtm_tp_allocation_clue" | ||
1592 | 27 | #define GTM_TPRESTART_LOG_DELTA "$gtm_tprestart_log_delta" | ||
1593 | 28 | #define GTM_TPRESTART_LOG_LIMIT "$gtm_tprestart_log_first" | ||
1594 | 29 | #define GTM_FULLBLOCKWRITES "$gtm_fullblockwrites" | ||
1595 | 30 | |||
1596 | 31 | /* White-box testing */ | ||
1597 | 32 | #define GTM_WHITE_BOX_TEST_CASE_ENABLE "$gtm_white_box_test_case_enable" | ||
1598 | 33 | #define GTM_WHITE_BOX_TEST_CASE_NUMBER "$gtm_white_box_test_case_number" | ||
1599 | 34 | #define GTM_WHITE_BOX_TEST_CASE_COUNT "$gtm_white_box_test_case_count" | ||
1600 | 35 | |||
1601 | 36 | /* Indirection-cache */ | ||
1602 | 37 | #define GTM_MAX_INDRCACHE_MEMORY "$gtm_max_indrcache_memory" | ||
1603 | 38 | #define GTM_MAX_INDRCACHE_COUNT "$gtm_max_indrcache_count" | ||
1604 | 39 | |||
1605 | 40 | /* MUPIP BACKUP */ | ||
1606 | 41 | # define GTM_BAK_TEMPDIR_LOG_NAME "$GTM_BAKTMPDIR" | ||
1607 | 42 | |||
1608 | 43 | /* Pattern match operator */ | ||
1609 | 44 | #define PAT_FILE "$gtm_pattern_file" | ||
1610 | 45 | #define PAT_TABLE "$gtm_pattern_table" | ||
1611 | 46 | |||
1612 | 47 | /* Alternative Collation */ | ||
1613 | 48 | #define CT_PREFIX "$gtm_collate_" | ||
1614 | 49 | #define LCT_PREFIX "$gtm_local_collate" | ||
1615 | 50 | #define LCT_STDNULL "$gtm_lct_stdnull" | ||
1616 | 51 | |||
1617 | 52 | /* Miscellaneous */ | ||
1618 | 53 | #define GTM_DEBUG_LEVEL_ENVLOG "$gtmdbglvl" | ||
1619 | 54 | #define GTM_PRINCIPAL "$gtm_principal" | ||
1620 | 55 | #define GTM_ZINTERRUPT "$gtm_zinterrupt" | ||
1621 | 56 | #define SYSID "$gtm_sysid" | ||
1622 | 57 | #define ZCOMPILE "$gtmcompile" | ||
1623 | 58 | #define GTM_ZROUTINES "$gtmroutines" | ||
1624 | 59 | #define ZYERROR "$gtm_zyerror" | ||
1625 | 60 | #define ZTRAP_FORM "$gtm_ztrap_form" | ||
1626 | 61 | #define ZTRAP_NEW "$gtm_ztrap_new" | ||
1627 | 62 | #define ZDATE_FORM "$gtm_zdate_form" | ||
1628 | 63 | #define DISABLE_ALIGN_STRINGS "$gtm_disable_alignstr" | ||
1629 | 64 | #define GTM_MAX_SOCKETS "$gtm_max_sockets" | ||
1630 | 65 | #define GTM_MEMORY_RESERVE "$gtm_memory_reserve" | ||
1631 | 66 | #define GTM_ZQUIT_ANYWAY "$gtm_zquit_anyway" | ||
1632 | 67 | #define GTM_NOUNDEF "$gtm_noundef" | ||
1633 | 68 | #define GTM_PROMPT "$gtm_prompt" | ||
1634 | 69 | |||
1635 | 70 | /* -------------------------- Unix only -------------------------- */ | ||
1636 | 71 | |||
1637 | 72 | /* Database */ | ||
1638 | 73 | #define GTM_TMP_ENV "$gtm_tmp" | ||
1639 | 74 | #define GTM_SHMFLAGS "$gtm_shmatflags" | ||
1640 | 75 | |||
1641 | 76 | /* Replication */ | ||
1642 | 77 | #define GTM_REPL_INSTANCE "$gtm_repl_instance" | ||
1643 | 78 | #define GTM_REPL_INSTNAME "$gtm_repl_instname" | ||
1644 | 79 | #define GTM_REPL_INSTSECONDARY "$gtm_repl_instsecondary" | ||
1645 | 80 | #define GTM_ZLIB_CMP_LEVEL "$gtm_zlib_cmp_level" | ||
1646 | 81 | #define GTM_EVENT_LOG_LIB_ENV "$gtm_event_log_libpath" | ||
1647 | 82 | #define GTM_EVENT_LOG_RTN_ENV "$gtm_event_log_rtn" | ||
1648 | 83 | |||
1649 | 84 | /* Unicode */ | ||
1650 | 85 | #define GTM_CHSET_ENV "$gtm_chset" | ||
1651 | 86 | #define GTM_PATNUMERIC_ENV "$gtm_patnumeric" | ||
1652 | 87 | #define GTM_BADCHAR_ENV "$gtm_badchar" | ||
1653 | 88 | #define GTM_ICU_MINOR_ENV "$gtm_icu_minorver" | ||
1654 | 89 | |||
1655 | 90 | /* Miscellaneous */ | ||
1656 | 91 | #define GTM_LOG_ENV "$gtm_log" | ||
1657 | 92 | #define GTM_PRINCIPAL_EDITING "$gtm_principal_editing" | ||
1658 | 93 | #define GTM_QUIET_HALT "$gtm_quiet_halt" | ||
1659 | 94 | #define GTM_NON_BLOCKED_WRITE_RETRIES "$gtm_non_blocked_write_retries" |
This set of changes doesn't break the compile.