1
/* -*- Mode: C; c-basic-offset:4 ; -*- */
3
* Copyright (C) 1997 University of Chicago.
4
* See COPYRIGHT notice in top-level directory.
8
#include "adio_extern.h"
10
void ADIOI_NTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int *error_code)
14
static char myname[] = "ADIOI_NTFS_FCNTL";
18
case ADIO_FCNTL_GET_FSIZE:
19
fcntl_struct->fsize = SetFilePointer(fd->fd_sys, 0, 0, FILE_END);
20
if (fd->fp_sys_posn != -1)
22
dwTemp = DWORDHIGH(fd->fp_sys_posn);
23
if (SetFilePointer(fd->fd_sys, DWORDLOW(fd->fp_sys_posn), &dwTemp, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
28
*error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
29
myname, __LINE__, MPI_ERR_IO,
30
"**io", "**io %s", ADIOI_NTFS_Strerror(err));
35
/* --BEGIN ERROR HANDLING-- */
36
if (fcntl_struct->fsize == INVALID_SET_FILE_POINTER)
38
dwTemp = GetLastError();
39
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
40
MPIR_ERR_RECOVERABLE, myname,
41
__LINE__, MPI_ERR_IO, "**io",
42
"**io %s", ADIOI_NTFS_Strerror(dwTemp));
45
/* --END ERROR HANDLING-- */
46
*error_code = MPI_SUCCESS;
49
case ADIO_FCNTL_SET_DISKSPACE:
50
ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
53
case ADIO_FCNTL_SET_ATOMICITY:
54
fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
55
*error_code = MPI_SUCCESS;
58
*error_code = MPI_ERR_UNSUPPORTED_OPERATION;
63
/* --BEGIN ERROR HANDLING-- */
64
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
68
"**flag", "**flag %d", flag);
70
/* --END ERROR HANDLING-- */