2 * This Cplant(TM) source code is the property of Sandia National
5 * This Cplant(TM) source code is copyrighted by Sandia National
8 * The redistribution of this Cplant(TM) source code is subject to the
9 * terms of the GNU Lesser General Public License
10 * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
12 * Cplant(TM) Copyright 1998-2004 Sandia Corporation.
13 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
14 * license for use of this work by or on behalf of the US Government.
15 * Export of this program may require a license from the United States
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 * Questions or comments about this library should be sent to:
37 * Sandia National Laboratories, New Mexico
39 * Albuquerque, NM 87185-1110
45 * Extended application programmers interface for IO as found on Cray RedStorm
46 * and the other current SUNMos/Puma/Cougar/Catamount systems.
53 * When compiled for use with libsysio, this allows one to move all the
54 * externals to a distinct namespace. When not, we want it to do nothing.
56 * NB: The choice of macro name here is dangerous. It's in the global
57 * namespace! We should fix that one of these days.
59 #if !defined(SYSIO_INTERFACE_NAME)
60 #define SYSIO_INTERFACE_NAME(_n) _n
63 #ifndef _IOID_T_DEFINED
64 #define _IOID_T_DEFINED
71 * Structure for strided I/O.
74 #ifndef __USE_FILE_OFFSET64
75 __off_t xtv_off; /* Stride/Extent offset. */
77 __off64_t xtv_off; /* Stride/Extent offset. */
79 size_t xtv_len; /* Stride/Extent length. */
82 #ifdef __USE_LARGEFILE64
84 __off64_t xtv_off; /* Stride/Extent offset. */
85 size_t xtv_len; /* Stride/Extent length. */
89 #ifdef HAVE_POSIX2008_PREADV
90 #define _SYSIO_PREADV_T int
92 #define _SYSIO_PREADV_T size_t
98 * Get status of previously posted async file IO operation.
100 extern int SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid);
103 * Wait for completion of a previously posted asynch file IO request.
105 extern ssize_t SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid);
108 * Post asynch read into buffers mapped by an iovec from file at given offset.
110 extern ioid_t SYSIO_INTERFACE_NAME(ipreadv)(int fd,
111 const struct iovec *iov,
115 #ifdef _LARGEFILE64_SOURCE
117 * Post asynch read into buffers mapped by an iovec from file at given offset.
119 extern ioid_t SYSIO_INTERFACE_NAME(ipread64v)(int fd,
120 const struct iovec *iov,
126 * Post asynch read into buffer from file at given offset.
128 extern ioid_t SYSIO_INTERFACE_NAME(ipread)(int fd,
133 #ifdef _LARGEFILE64_SOURCE
135 * Post asynch read into buffer from file at given offset.
137 extern ioid_t SYSIO_INTERFACE_NAME(ipread64)(int fd,
144 * Read into buffers mapped by an iovec from file at given offset.
146 extern ssize_t SYSIO_INTERFACE_NAME(preadv)(int fd,
147 const struct iovec *iov,
148 _SYSIO_PREADV_T count,
151 #ifdef _LARGEFILE64_SOURCE
153 * Read into buffers mapped by an iovec from file at given offset.
155 extern ssize_t SYSIO_INTERFACE_NAME(pread64v)(int fd,
156 const struct iovec *iov,
157 _SYSIO_PREADV_T count,
162 * Post asynch read into buffers mapped by an iovec.
164 extern ioid_t SYSIO_INTERFACE_NAME(ireadv)(int fd,
165 const struct iovec *iov,
171 extern ioid_t SYSIO_INTERFACE_NAME(iread)(int fd,
176 * Post async read into buffers mapped by iovec from regions mapped
179 * NB: An adaptation of "listio" from Argonne's PVFS.
181 extern ioid_t SYSIO_INTERFACE_NAME(ireadx)(int fd,
182 const struct iovec *iov,
184 const struct xtvec *xtv,
187 #ifdef __USE_LARGEFILE64
189 * Post async read into buffers mapped by iovec from regions mapped
192 * NB: An adaptation of "listio" from Argonne's PVFS.
194 extern ioid_t SYSIO_INTERFACE_NAME(iread64x)(int fd,
195 const struct iovec *iov,
197 const struct xtvec64 *xtv,
202 * Read into buffers mapped by iovec from regions mapped
205 * NB: An adaptation of "listio" from Argonne's PVFS.
207 extern ssize_t SYSIO_INTERFACE_NAME(readx)(int fd,
208 const struct iovec *iov,
210 const struct xtvec *xtv,
213 #ifdef __USE_LARGEFILE64
215 * Read into buffers mapped by iovec from regions mapped
218 * NB: An adaptation of "listio" from Argonne's PVFS.
220 extern ssize_t SYSIO_INTERFACE_NAME(read64x)(int fd,
221 const struct iovec *iov,
223 const struct xtvec64 *xtv,
228 * Post asynch write from buffers mapped by an iovec to file at given offset.
230 extern ioid_t SYSIO_INTERFACE_NAME(ipwritev)(int fd,
231 const struct iovec *iov,
234 #ifdef _LARGEFILE64_SOURCE
236 * Post asynch write from buffers mapped by an iovec to file at given offset.
238 extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64v)(int fd,
239 const struct iovec *iov,
245 * Post asynch write from buffer to file at given offset.
247 extern ioid_t SYSIO_INTERFACE_NAME(ipwrite)(int fd,
252 #ifdef _LARGEFILE64_SOURCE
254 * Post asynch write from buffer to file at given offset.
256 extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64)(int fd,
263 * Write from buffers mapped by an iovec to file at given offset.
265 extern ssize_t SYSIO_INTERFACE_NAME(pwritev)(int fd,
266 const struct iovec *iov,
267 _SYSIO_PREADV_T count,
270 #ifdef _LARGEFILE64_SOURCE
272 * Write from buffers mapped by an iovec to file at given offset.
274 extern ssize_t SYSIO_INTERFACE_NAME(pwrite64v)(int fd,
275 const struct iovec *iov,
276 _SYSIO_PREADV_T count,
281 * Post asynch write from buffer to file at given offset.
283 extern ioid_t SYSIO_INTERFACE_NAME(iwritev)(int fd,
284 const struct iovec *iov,
288 * Write from buffer to file at given offset.
290 extern ioid_t SYSIO_INTERFACE_NAME(iwrite)(int fd,
295 * Post async write from buffers mapped by iovec to regions mapped
298 * NB: An adaptation of "listio" from Argonne's PVFS.
300 extern ioid_t SYSIO_INTERFACE_NAME(iwritex)(int fd,
301 const struct iovec *iov,
303 const struct xtvec *xtv,
306 #ifdef __USE_LARGEFILE64
308 * Post async write from buffers mapped by iovec to regions mapped
311 * NB: An adaptation of "listio" from Argonne's PVFS.
313 extern ioid_t SYSIO_INTERFACE_NAME(iwrite64x)(int fd,
314 const struct iovec *iov,
316 const struct xtvec64 *xtv,
321 * Write from buffers mapped by iovec to regions mapped
324 * NB: An adaptation of "listio" from Argonne's PVFS.
326 extern ssize_t SYSIO_INTERFACE_NAME(writex)(int fd,
327 const struct iovec *iov,
329 const struct xtvec *xtv,
332 #ifdef __USE_LARGEFILE64
334 * Write from buffers mapped by iovec to regions mapped
337 * NB: An adaptation of "listio" from Argonne's PVFS.
339 extern ssize_t SYSIO_INTERFACE_NAME(write64x)(int fd,
340 const struct iovec *iov,
342 const struct xtvec64 *xtv,
345 #endif /* ! _XTIO_H_ */