Feature #1983: Made CmiWallTimer monotonic in the common case
[charm.git] / src / libs / ck-libs / ampi / romio / adio / ad_pfs / ad_pfs_close.c
blobd5d337134aeb95e877c1207f7f5cdb42371ed988
1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3 * $Id$
5 * Copyright (C) 1997 University of Chicago.
6 * See COPYRIGHT notice in top-level directory.
7 */
9 #include "ad_pfs.h"
10 #ifdef PROFILE
11 #include "mpe.h"
12 #endif
14 void ADIOI_PFS_Close(ADIO_File fd, int *error_code)
16 int err;
17 #ifndef PRINT_ERR_MSG
18 static char myname[] = "ADIOI_PFS_CLOSE";
19 #endif
21 #ifdef PROFILE
22 MPE_Log_event(9, 0, "start close");
23 #endif
24 err = close(fd->fd_sys);
25 #ifdef PROFILE
26 MPE_Log_event(10, 0, "end close");
27 #endif
28 #ifdef PRINT_ERR_MSG
29 *error_code = (err == 0) ? MPI_SUCCESS : MPI_ERR_UNKNOWN;
30 #else
31 if (err == -1) {
32 *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
33 myname, "I/O Error", "%s", strerror(errno));
34 ADIOI_Error(fd, *error_code, myname);
36 else *error_code = MPI_SUCCESS;
37 #endif