{
{  The purpose of this procedure is to preallocate additional space into
{ the server image file if the current highest written address (eoi) is
{ getting close to the current preallocaetd space.
{ If space cannot be obtained then an error condition of
{ dfe$no_space_for_server_pages is returned.
{ This procedure does not change the image file in any way.

  PROCEDURE [INLINE] dfp$expand_image_file
    (VAR image_file_id: dft$image_file_id;
     VAR status: ost$status);

    CONST
      dfc$preallocate_page_count = 20;

    status.normal := TRUE;
    IF image_file_id.allocated_size < (#OFFSET (image_file_id.p_current_eoi) +
          (2 * osv$page_size)) THEN
      mmp$os_preallocate_file_space (image_file_id.p_image_file,
            (#OFFSET (image_file_id.p_current_eoi) +
            (dfc$preallocate_page_count * osv$page_size)),  {wait secs} 60, status);
      IF status.normal THEN
        image_file_id.allocated_size := #OFFSET (image_file_id.p_current_eoi) +
              (dfc$preallocate_page_count * osv$page_size);
      ELSE
        osp$set_status_abnormal (dfc$file_server_id,
              dfe$no_space_for_server_pages, image_file_id.p_image_header^.
              server_mainframe_name, status);
        CASE image_file_id.operation OF
        = dfc$image_source_timeout =
          osp$append_status_parameter (osc$status_parameter_delimiter,
                ' Pages will remain in memory until server activation. IF ' CAT
                'a terminate_system occurs the server will be terminated.',
                status);
        = dfc$image_source_deadstart =
          osp$append_status_parameter (osc$status_parameter_delimiter,
                ' Recovery of the server will NOT be possible.', status);
        ELSE
        CASEND;
        RETURN;
      IFEND;
    IFEND;
  PROCEND dfp$expand_image_file;
?? PUSH (LISTEXT := ON) ??
*copyc dft$image_file_id
*copyc i#build_adaptable_seq_pointer
*copyc mmp$os_preallocate_file_space
*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal
*copyc dfe$error_condition_codes
*copyc ost$status
*copyc osv$page_size
?? POP ??
