Index: trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp	(revision 21504)
+++ trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp	(revision 21505)
@@ -63,8 +63,4 @@
 #include "internal/fileaio.h"
 
-/* Prevent including some header files the C++ compiler doesn't like. */
-#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
-#define _LINUX_BYTEORDER_SWABB_H
-#include <linux/aio_abi.h>
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -77,4 +73,16 @@
 *   Structures and Typedefs                                                    *
 *******************************************************************************/
+/** The async I/O context handle */
+typedef unsigned long LNXKAIOCONTEXT;
+
+/**
+ * Supported commands for the iocbs
+ */
+enum
+{
+    LNXKAIO_IOCB_CMD_READ = 0,
+    LNXKAIO_IOCB_CMD_WRITE
+};
+
 /**
  * The iocb structure of a request which is passed to the kernel.
@@ -167,5 +175,5 @@
 {
     /** Handle to the async I/O context. */
-    aio_context_t       AioContext;
+    LNXKAIOCONTEXT      AioContext;
     /** Maximum number of requests this context can handle. */
     int                 cRequestsMax;
@@ -195,5 +203,5 @@
     RTFILEAIOREQSTATE     enmState;
     /** The I/O context this request is associated with. */
-    aio_context_t         AioContext;
+    LNXKAIOCONTEXT        AioContext;
     /** Return code the request completed with. */
     int                   Rc;
@@ -219,5 +227,5 @@
  * Creates a new async I/O context.
  */
-DECLINLINE(int) rtFileAsyncIoLinuxCreate(unsigned cEvents, aio_context_t *pAioContext)
+DECLINLINE(int) rtFileAsyncIoLinuxCreate(unsigned cEvents, LNXKAIOCONTEXT *pAioContext)
 {
     int rc = syscall(__NR_io_setup, cEvents, pAioContext);
@@ -231,5 +239,5 @@
  * Destroys a async I/O context.
  */
-DECLINLINE(int) rtFileAsyncIoLinuxDestroy(aio_context_t AioContext)
+DECLINLINE(int) rtFileAsyncIoLinuxDestroy(LNXKAIOCONTEXT AioContext)
 {
     int rc = syscall(__NR_io_destroy, AioContext);
@@ -243,5 +251,5 @@
  * Submits an array of I/O requests to the kernel.
  */
-DECLINLINE(int) rtFileAsyncIoLinuxSubmit(aio_context_t AioContext, long cReqs, LNXKAIOIOCB **ppIoCB, int *pcSubmitted)
+DECLINLINE(int) rtFileAsyncIoLinuxSubmit(LNXKAIOCONTEXT AioContext, long cReqs, LNXKAIOIOCB **ppIoCB, int *pcSubmitted)
 {
     int rc = syscall(__NR_io_submit, AioContext, cReqs, ppIoCB);
@@ -257,5 +265,5 @@
  * Cancels a I/O request.
  */
-DECLINLINE(int) rtFileAsyncIoLinuxCancel(aio_context_t AioContext, PLNXKAIOIOCB pIoCB, PLNXKAIOIOEVENT pIoResult)
+DECLINLINE(int) rtFileAsyncIoLinuxCancel(LNXKAIOCONTEXT AioContext, PLNXKAIOIOCB pIoCB, PLNXKAIOIOEVENT pIoResult)
 {
     int rc = syscall(__NR_io_cancel, AioContext, pIoCB, pIoResult);
@@ -270,5 +278,5 @@
  * @returns Number of events (natural number w/ 0), IPRT error code (negative).
  */
-DECLINLINE(int) rtFileAsyncIoLinuxGetEvents(aio_context_t AioContext, long cReqsMin, long cReqs,
+DECLINLINE(int) rtFileAsyncIoLinuxGetEvents(LNXKAIOCONTEXT AioContext, long cReqsMin, long cReqs,
                                             PLNXKAIOIOEVENT paIoResults, struct timespec *pTimeout)
 {
@@ -289,5 +297,5 @@
      * completion port.
      */
-    aio_context_t AioContext = 0;
+    LNXKAIOCONTEXT AioContext = 0;
     rc = rtFileAsyncIoLinuxCreate(1, &AioContext);
     if (RT_FAILURE(rc))
@@ -385,5 +393,5 @@
                                     void *pvBuf, size_t cbRead, void *pvUser)
 {
-    return rtFileAioReqPrepareTransfer(hReq, hFile, IOCB_CMD_PREAD,
+    return rtFileAioReqPrepareTransfer(hReq, hFile, LNXKAIO_IOCB_CMD_READ,
                                        off, pvBuf, cbRead, pvUser);
 }
@@ -393,5 +401,5 @@
                                      void *pvBuf, size_t cbWrite, void *pvUser)
 {
-    return rtFileAioReqPrepareTransfer(hReq, hFile, IOCB_CMD_PWRITE,
+    return rtFileAioReqPrepareTransfer(hReq, hFile, LNXKAIO_IOCB_CMD_WRITE,
                                        off, pvBuf, cbWrite, pvUser);
 }
