1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
4 * Copyright (C) 1997 University of Chicago.
5 * See COPYRIGHT notice in top-level directory.
9 #include "adio_extern.h"
11 #ifdef HAVE_WEAK_SYMBOLS
13 #if defined(HAVE_PRAGMA_WEAK)
14 #pragma weak MPI_File_get_errhandler = PMPI_File_get_errhandler
15 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
16 #pragma _HP_SECONDARY_DEF PMPI_File_get_errhandler MPI_File_get_errhandler
17 #elif defined(HAVE_PRAGMA_CRI_DUP)
18 #pragma _CRI duplicate MPI_File_get_errhandler as PMPI_File_get_errhandler
19 /* end of weak pragmas */
22 /* Include mapping from MPI->PMPI */
23 #define MPIO_BUILD_PROFILING
28 MPI_File_get_errhandler - Returns the error handler for a file
31 . fh - file handle (handle)
34 . errhandler - error handler (handle)
38 int MPI_File_get_errhandler(MPI_File mpi_fh
, MPI_Errhandler
*errhandler
)
40 int error_code
= MPI_SUCCESS
;
42 static char myname
[] = "MPI_FILE_GET_ERRHANDLER";
45 MPIU_THREAD_CS_ENTER(ALLFUNC
,);
47 if (mpi_fh
== MPI_FILE_NULL
) {
48 *errhandler
= CtvAccess(ADIOI_DFLT_ERR_HANDLER
);
51 fh
= MPIO_File_resolve(mpi_fh
);
52 /* --BEGIN ERROR HANDLING-- */
53 if ((fh
<= (MPI_File
) 0) || ((fh
)->cookie
!= ADIOI_FILE_COOKIE
))
55 error_code
= MPIO_Err_create_code(MPI_SUCCESS
, MPIR_ERR_RECOVERABLE
,
56 myname
, __LINE__
, MPI_ERR_ARG
,
58 error_code
= MPIO_Err_return_file(MPI_FILE_NULL
, error_code
);
61 /* --END ERROR HANDLING-- */
63 *errhandler
= fh
->err_handler
;
67 MPIU_THREAD_CS_EXIT(ALLFUNC
,);