1 /* 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #ifndef _ASYNC_H 19 #define _ASYNC_H 20 21 /** \file 22 * Externally visiable Fortran asynchronous IO routines (from async.c) 23 */ 24 25 struct asy; 26 27 #define FIO_EEOF 217 28 29 /** \brief 30 * Asynchronous fseek 31 */ 32 int Fio_asy_fseek(struct asy *asy, long offset, int whence); 33 34 /** \brief 35 * Enable asynchronous IO, disable stdio 36 */ 37 int Fio_asy_enable(struct asy *asy); 38 39 /** \brief 40 * Disable asynchronous IO, enable stdio 41 */ 42 int Fio_asy_disable(struct asy *asy); 43 44 /** \brief 45 * Initialize a file for asynchronous IO, called from open 46 */ 47 int Fio_asy_open(FILE *fp, struct asy **pasy); 48 49 /** \brief 50 * Start an asynch read 51 */ 52 int Fio_asy_read(struct asy *asy, void *adr, long len); 53 54 /** \brief 55 * Start an asynch write 56 */ 57 int Fio_asy_write(struct asy *asy, void *adr, long len); 58 59 /** \\brief 60 * For vectored i/o, start reads or writes 61 */ 62 int Fio_asy_start(struct asy *asy); 63 64 /** \brief 65 * close asynch i/o called from close 66 */ 67 int Fio_asy_close(struct asy *asy); 68 69 #endif /* _ASYNC_H */ 70