root/ompi/mca/io/romio321/romio/adio/common/ad_flush.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_GEN_Flush

   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 "adio.h"
   9 
  10 #ifdef HAVE_UNISTD_H
  11 #include <unistd.h>
  12 #endif
  13 
  14 void ADIOI_GEN_Flush(ADIO_File fd, int *error_code)
  15 {
  16     int err;
  17     static char myname[] = "ADIOI_GEN_FLUSH";
  18 
  19     /* the deferred-open optimization may mean that a file has not been opened
  20      * on this processor */
  21     if (fd->is_open > 0) {
  22         err = fsync(fd->fd_sys);
  23         /* --BEGIN ERROR HANDLING-- */
  24         if (err == -1) {
  25             *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  26                     myname, __LINE__, MPI_ERR_IO,
  27                     "**io",
  28                     "**io %s", strerror(errno));
  29             return;
  30         }
  31         /* --END ERROR HANDLING-- */
  32     }
  33 
  34     *error_code = MPI_SUCCESS;
  35 }

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