1 03/08/82  get_temp_segments_
 2 
 3 
 4 Entry points in get_temp_segments_:
 5    (List is generated by the help command)
 6 
 7 
 8 :Entry: get_temp_segments_:  09/25/86  get_temp_segments_
 9 
10 
11 Function: puts temporary segments in the process directory for
12 whatever purpose the caller may have.  The segments returned to the
13 caller are zero-length.
14 
15 A free pool of temporary segments is associated with each user process.
16 The pool concept makes it possible to use the same temporary segment
17 more than once during the life of a process.  Reusing temporary
18 segments in this way avoids the cost of creating a segment each time
19 one is needed.
20 
21 
22 Syntax:
23 declare get_temp_segments_ entry (char(*), (*) ptr, fixed bin(35));
24 call get_temp_segments_ (program, ptrs, code);
25 
26 
27 Arguments:
28 program
29    is a 32-character field identifying the program on whose behalf the
30    temporary segment is to be used.  This field is displayed by the
31    list_temp_segments command.  Besides giving the name of the command
32    or subroutine invoked by the user, it can also briefly describe how
33    the temporary segment is used; for example, "sort_seg (sort
34    indexes)."  (Input)
35 ptrs
36    is an array of returned pointers to the requested temporary
37    segments.  (Output)
38 code
39    is a standard status code.  (Output)
40 
41 
42 Notes:  This subroutine assigns temporary segments to its caller.  It
43 creates new temporary segments and adds them to the free pool if there
44 currently are not enough available to satisfy the request.  The
45 temporary segments are created in the process directory with a unique
46 name including the temp.xxxx suffix, where xxxx is the segment number
47 of the segment in octal.  See the description of the
48 release_temp_segments_ or the release_temp_segment_ subroutine for a
49 description of how to return temporary segments to the free pool.
50 
51 The number of segments returned to the caller is determined by the
52 bounds of the ptrs array above.
53 
54 The list_temp_segments command (described in the MPM Commands) can be
55 used to list the temporary segments being used by a process.