… | |
… | |
51 | /*****************************************************************************/ |
51 | /*****************************************************************************/ |
52 | /* syscall wrapdadoop */ |
52 | /* syscall wrapdadoop */ |
53 | |
53 | |
54 | #include <sys/syscall.h> /* no glibc wrappers */ |
54 | #include <sys/syscall.h> /* no glibc wrappers */ |
55 | |
55 | |
56 | /* aio_abi.h is not verioned in any way, so we cannot test for its existance */ |
56 | /* aio_abi.h is not versioned in any way, so we cannot test for its existance */ |
57 | #define IOCB_CMD_POLL 5 |
57 | #define IOCB_CMD_POLL 5 |
58 | |
58 | |
59 | /* taken from linux/fs/aio.c */ |
59 | /* taken from linux/fs/aio.c */ |
60 | #define AIO_RING_MAGIC 0xa10a10a1 |
60 | #define AIO_RING_MAGIC 0xa10a10a1 |
61 | #define AIO_RING_INCOMPAT_FEATURES 0 |
61 | #define AIO_RING_INCOMPAT_FEATURES 0 |
… | |
… | |
282 | /* This happens when the ring buffer is full, at least. I assume this means |
282 | /* This happens when the ring buffer is full, at least. I assume this means |
283 | * that the event was queued synchronously during io_submit, and thus |
283 | * that the event was queued synchronously during io_submit, and thus |
284 | * the buffer overflowd. |
284 | * the buffer overflowd. |
285 | * In this case, we just try next loop iteration. |
285 | * In this case, we just try next loop iteration. |
286 | */ |
286 | */ |
287 | memcpy (linuxaio_submits, linuxaio_submits + submitted, (linuxaio_submitcnt - submitted) * sizeof (*linuxaio_submits)); |
287 | memmove (linuxaio_submits, linuxaio_submits + submitted, (linuxaio_submitcnt - submitted) * sizeof (*linuxaio_submits)); |
288 | linuxaio_submitcnt -= submitted; |
288 | linuxaio_submitcnt -= submitted; |
289 | timeout = 0; |
289 | timeout = 0; |
290 | break; |
290 | break; |
291 | } |
291 | } |
292 | else |
292 | else |