root/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_fcntl.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_TESTFS_Fcntl

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 2001 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "ad_testfs.h"
   9 #include "adioi.h"
  10 #include "adio_extern.h"
  11 
  12 void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, 
  13                         int *error_code)
  14 {
  15     int myrank, nprocs;
  16     static char myname[] = "ADIOI_TESTFS_FCNTL";
  17 
  18     *error_code = MPI_SUCCESS;
  19 
  20     MPI_Comm_size(fd->comm, &nprocs);
  21     MPI_Comm_rank(fd->comm, &myrank);
  22     FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fcntl called on %s\n", 
  23             myrank, nprocs, fd->filename);
  24 
  25     switch(flag) {
  26     case ADIO_FCNTL_GET_FSIZE:
  27         fcntl_struct->fsize = 0;
  28         *error_code = MPI_SUCCESS;
  29         break;
  30 
  31     case ADIO_FCNTL_SET_DISKSPACE:
  32         *error_code = MPI_SUCCESS;
  33         break;
  34 
  35     case ADIO_FCNTL_SET_ATOMICITY:
  36         fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
  37         *error_code = MPI_SUCCESS;
  38         break;
  39 
  40     default:
  41         /* --BEGIN ERROR HANDLING-- */
  42         *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  43                                            myname, __LINE__, 
  44                                            MPI_ERR_ARG,
  45                                            "**flag", "**flag %d", flag);
  46         return;
  47         /* --END ERROR HANDLING-- */
  48     }
  49 }

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