Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (H-K)
Guardian Procedure Calls Reference Manual—522629-013
7-4
HEADROOM_ENSURE_ Procedure
Syntax for TAL Programmers
Parameters
ret-val returned value
INT(32)
returns the number of bytes between the current stack pointer and the stack limit if
room is <= 0D. If room is > 0D, ret-val indicates the outcome of the operation.
It returns one of the following values:
0D Either the requested space already exists in the stack space or the stack
space was successfully enlarged to make enough room for the request.
5D The request would have exceeded the maximum stack size.
6D The stack pointer is invalid.
7D The stack pointer does not address a main stack or a privileged stack.
36D The system was unable to allocate memory.
43D The system was unable to obtain swap space.
45D The Kernel Managed Swap Facility (KMSF) was unable to obtain swap
space.
room input
INT(32):value
in the TNS/R environment, specifies the additional space in bytes to be allocated to
the stack if
room is > 0D. If room is <= 0D, HEADROOM_ENSURE_ returns the
current headroom; that is, the number of bytes between the current stack pointer
and the limit of the stack. In the TNS/E environment, specifies the minimum size of
either the memory stack or the RSE backing store. When
room is <=0D, it is the
size of the remaining memory stack (calculated as the difference between the
maximum stack and the used stack amount.)
Considerations
•
If HEADROOM_ENSURE_ returns an error (not 0D), the stack is not enlarged.
•
If HEADROOM_ENSURE_ is called from a user (nonprivileged) process, the main
stack of the process is the target. If the call is made from a privileged procedure,
the privileged stack is the target.
•
The amount by which the stack is enlarged might be greater than the value
specified in
room. The stack size is rounded up by a unit determined by the
ret-val := HEADROOM_ENSURE_ ( room ); ! i