aio.h revision ba3594ba9b5dd4c846c472a8d657edcb7c8109ac
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _AIO_H
#define _AIO_H
#include <sys/feature_tests.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
#error "POSIX Asynchronous I/O is not supported in POSIX.1-1990"
#endif
/* large file compilation environment setup */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else
#define aio_read aio_read64
#define aio_write aio_write64
#define lio_listio lio_listio64
#define aio_error aio_error64
#define aio_return aio_return64
#define aio_cancel aio_cancel64
#define aio_suspend aio_suspend64
#define aio_fsync aio_fsync64
#define aio_waitn aio_waitn64
#endif
#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
/*
* In the LP64 compilation environment, map the 64-bit-explicit versions
* back to the generic versions: all i/o operations are already "large file"
*/
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else
#define aio_read64 aio_read
#define aio_write64 aio_write
#define lio_listio64 lio_listio
#define aio_error64 aio_error
#define aio_return64 aio_return
#define aio_cancel64 aio_cancel
#define aio_suspend64 aio_suspend
#define aio_fsync64 aio_fsync
#define aio_waitn64 aio_waitn
#endif
#endif /* _LP64 && _LARGEFILE64_SOURCE */
/*
* function prototypes
*/
extern int lio_listio(int,
int, struct sigevent *_RESTRICT_KYWD);
extern int aio_cancel(int, aiocb_t *);
extern int aio_suspend(const aiocb_t *const[], int,
const struct timespec *);
const struct timespec *);
!defined(__PRAGMA_REDEFINE_EXTNAME))
extern int aio_read64(aiocb64_t *);
extern int aio_write64(aiocb64_t *);
extern int lio_listio64(int,
int, struct sigevent *_RESTRICT_KYWD);
extern int aio_error64(const aiocb64_t *);
extern int aio_cancel64(int, aiocb64_t *);
extern int aio_suspend64(const aiocb64_t *const[], int,
const struct timespec *);
extern int aio_fsync64(int, aiocb64_t *);
const struct timespec *);
#endif /* _LARGEFILE64_SOURCE */
#ifdef __cplusplus
}
#endif
#endif /* _AIO_H */