1
2
3
4
5
6
7
8
9
10
11 set_timax: stm: proc;
12
13
14
15
16
17
18
19
20
21
22
23
24 dcl arg char (arglen) based (argptr), argptr pointer,
25 (arglen, ret_length, timax) fixed bin,
26 code fixed bin (35),
27 fnum float bin (27),
28 ret_string char (120),
29 ring_0_message char (ret_length) based (addr (ret_string)),
30 bad_char char (1);
31
32 dcl cu_$arg_ptr ext entry (fixed bin, ptr, fixed bin, fixed bin (35)),
33 cv_float_ ext entry (char (*), fixed bin (35), float bin (27)),
34 hphcs_$pxss_set_timax ext entry (bit (36), fixed bin),
35 (com_err_, ioa_, ioa_$rs, phcs_$ring_0_message) ext entry options (variable),
36 get_process_id_ ext entry returns (bit(36));
37 dcl processid bit(36);
38 dcl linkage_error condition;
39
40 call cu_$arg_ptr (1, argptr, arglen, code);
41
42 if code ^= 0 then do;
43 call com_err_ (code, "set_timax");
44 return;
45 end;
46
47 call cv_float_ (arg, code, fnum);
48
49 if code ^= 0 then do;
50 bad_char = substr (arg, code, 1);
51 call com_err_ (0, "set_timax", "illegal character ""^a"" in argument ""^a"".", bad_char, arg);
52 return;
53 end;
54
55 timax = fnum * 1000000;
56
57 if timax > 0
58 then call ioa_ ("setting timax to ^.1f seconds.", fnum);
59 else call ioa_ ("resetting timax to default.");
60
61 processid = get_process_id_ ();
62
63 on linkage_error begin;
64 revert linkage_error;
65 call com_err_ (0, "set_timax", "Insufficient access to reset timax.");
66 go to out;
67 end;
68
69 call hphcs_$pxss_set_timax (processid, timax);
70
71 revert linkage_error;
72
73 if timax > 0 then do;
74 call ioa_$rs ("setting timax to ^.1f seconds.", ret_string, ret_length, fnum);
75 call phcs_$ring_0_message (ring_0_message);
76 end;
77 else call phcs_$ring_0_message ("setting timax to default.");
78
79 out:
80 return;
81
82 end;