summaryrefslogtreecommitdiffstats
path: root/cpukit/include/aio.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /cpukit/include/aio.h
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'cpukit/include/aio.h')
-rw-r--r--cpukit/include/aio.h193
1 files changed, 193 insertions, 0 deletions
diff --git a/cpukit/include/aio.h b/cpukit/include/aio.h
new file mode 100644
index 0000000000..95ed0fdb6c
--- /dev/null
+++ b/cpukit/include/aio.h
@@ -0,0 +1,193 @@
+/**
+ * @file
+ *
+ * @brief POSIX Asynchronous Input and Output
+ *
+ * This file contains the definitions related to POSIX Asynchronous
+ * Input and Output,
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _AIO_H
+#define _AIO_H
+
+#include <sys/cdefs.h>
+#include <unistd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup POSIX_AIO POSIX Asynchronous I/O Support
+ *
+ * @ingroup POSIXAPI
+ *
+ * @brief POSIX Asynchronous Input and Output
+ *
+ */
+/**@{**/
+
+#if defined(_POSIX_ASYNCHRONOUS_IO)
+
+/*
+ * 6.7.1 Data Definitions for Asynchronous Input and Output,
+ * P1003.1b-1993, p. 151
+ */
+
+#include <sys/types.h>
+#include <signal.h>
+#include <time.h>
+#include <fcntl.h>
+
+/*
+ * 6.7.1.2 Manifest Constants, P1003.1b-1993, p. 153
+ */
+
+#define AIO_CANCELED 0 /* all requested operations have been canceled */
+#define AIO_NOTCANCELED 1 /* some of the operations could not be canceled */
+ /* since they are in progress */
+#define AIO_ALLDONE 2 /* none of the requested operations could be */
+ /* canceled since they are already complete */
+
+/* lio_listio() options */
+
+/*
+ * LIO modes
+ */
+#define LIO_WAIT 0 /* calling process is to suspend until the */
+ /* operation is complete */
+#define LIO_NOWAIT 1 /* calling process is to continue execution while */
+ /* the operation is performed and no notification */
+ /* shall be given when the operation is completed */
+
+/*
+ * LIO opcodes
+ */
+#define LIO_NOP 0 /* no transfer is requested */
+#define LIO_READ 1 /* request a read() */
+#define LIO_WRITE 2 /* request a write() */
+#define LIO_SYNC 3 /* needed by aio_fsync() */
+
+/*
+ * 6.7.1.1 Asynchronous I/O Control Block, P1003.1b-1993, p. 151
+ */
+
+struct aiocb {
+ /* public */
+ int aio_fildes; /* File descriptor */
+ off_t aio_offset; /* File offset */
+ volatile void *aio_buf; /* Location of buffer */
+ size_t aio_nbytes; /* Length of transfer */
+ int aio_reqprio; /* Request priority offset */
+ struct sigevent aio_sigevent; /* Signal number and value */
+ int aio_lio_opcode; /* Operation to be performed */
+ /* private */
+ int error_code; /* Used for aio_error() */
+ ssize_t return_value; /* Used for aio_return() */
+};
+
+/*
+ * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154
+ */
+
+int aio_read(
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155
+ */
+
+int aio_write(
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158
+ */
+
+int lio_listio(
+ int mode,
+ struct aiocb *__restrict const list[__restrict],
+ int nent,
+ struct sigevent *__restrict sig
+);
+
+/*
+ * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161
+ */
+
+int aio_error(
+ const struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation,
+ * P1003.1b-1993, p. 162
+ */
+
+ssize_t aio_return(
+ const struct aiocb *aiocbp
+);
+
+/**
+ * @brief Cancel asynchronous I/O operation.
+ *
+ * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163
+ *
+ * @param[in] filedes is the file descriptor
+ * @param[in] aiocbp is a pointer to the asynchronous I/O control block
+ *
+ * @retval AIO_CANCELED The requested operation(s) were canceled.
+ * @retval AIO_NOTCANCELED Some of the requested operation(s) cannot be
+ * canceled since they are in progress.
+ * @retval AIO_ALLDONE None of the requested operation(s) could be canceled
+ * since they are already complete
+ */
+int aio_cancel(
+ int filedes,
+ struct aiocb *aiocbp
+);
+
+/*
+ * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164
+ */
+
+int aio_suspend(
+ const struct aiocb * const list[],
+ int nent,
+ const struct timespec *timeout
+);
+
+#if defined(_POSIX_SYNCHRONIZED_IO)
+
+/*
+ * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166
+ */
+
+int aio_fsync(
+ int op,
+ struct aiocb *aiocbp
+);
+
+#endif /* _POSIX_SYNCHRONIZED_IO */
+
+#endif /* _POSIX_ASYNCHRONOUS_IO */
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */