00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_hfs.h"
00009
00010 void ADIOI_HFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
00011 {
00012 int err;
00013 #ifndef PRINT_ERR_MSG
00014 static char myname[] = "ADIOI_HFS_RESIZE";
00015 #endif
00016
00017 err = ftruncate64(fd->fd_sys, size);
00018 if (err == -1) {
00019 #ifdef MPICH2
00020 *error_code = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, myname, __LINE__, MPI_ERR_IO, "**io",
00021 "**io %s", strerror(errno));
00022 #elif defined(PRINT_ERR_MSG)
00023 *error_code = MPI_ERR_UNKNOWN;
00024 #else
00025 *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
00026 myname, "I/O Error", "%s", strerror(errno));
00027 ADIOI_Error(fd, *error_code, myname);
00028 #endif
00029 }
00030 else *error_code = MPI_SUCCESS;
00031 }