root/ompi/mca/io/romio321/romio/adio/ad_hfs/ad_hfs_resize.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_HFS_Resize

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 1997 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "ad_hfs.h"
   9 
  10 void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
  11 {
  12     int err;
  13 #ifndef PRINT_ERR_MSG
  14     static char myname[] = "ADIOI_HFS_RESIZE";
  15 #endif
  16     
  17     err = ftruncate64(fd->fd_sys, size);
  18     if (err == -1) {
  19 #ifdef MPICH
  20         *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
  21             "**io %s", strerror(errno));
  22 #elif defined(PRINT_ERR_MSG)
  23         *error_code = MPI_ERR_UNKNOWN;
  24 #else /* MPICH-1 */
  25         *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
  26                               myname, "I/O Error", "%s", strerror(errno));
  27         ADIOI_Error(fd, *error_code, myname);       
  28 #endif
  29     }
  30     else *error_code = MPI_SUCCESS;
  31 }

/* [<][>][^][v][top][bottom][index][help] */