summaryrefslogtreecommitdiff
path: root/libasyncio/include/asyncio/AsyncIO.h
diff options
context:
space:
mode:
authorJerry Zhang <zhangjerry@google.com>2018-02-12 16:15:50 -0800
committerJerry Zhang <zhangjerry@google.com>2018-03-02 16:28:15 -0800
commitc3d4e7226a74c3c4092480606ef07e0d30a2d42d (patch)
treec8384c535758600369b6f545d6ae49567b8e955a /libasyncio/include/asyncio/AsyncIO.h
parentfd01164a8d3f350abf2ba26f6ff693d7ec4afa0e (diff)
Make libasyncio headers usable from C
This allows us to enable LTP tests for io_* syscalls. Bug: 31152298 Test: LTP tests pass Change-Id: Ic25189d8bf25cdacfa0f144ac57c7b2827adcd9f
Diffstat (limited to 'libasyncio/include/asyncio/AsyncIO.h')
-rw-r--r--libasyncio/include/asyncio/AsyncIO.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/libasyncio/include/asyncio/AsyncIO.h b/libasyncio/include/asyncio/AsyncIO.h
index e3fb93a4d..9620d2a84 100644
--- a/libasyncio/include/asyncio/AsyncIO.h
+++ b/libasyncio/include/asyncio/AsyncIO.h
@@ -17,9 +17,9 @@
#ifndef _ASYNCIO_H
#define _ASYNCIO_H
-#include <cstring>
-#include <cstdint>
#include <linux/aio_abi.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <time.h>
@@ -35,10 +35,14 @@ extern "C" {
int io_setup(unsigned nr, aio_context_t* ctxp);
int io_destroy(aio_context_t ctx);
-int io_submit(aio_context_t ctx, long nr, iocb** iocbpp);
-int io_getevents(aio_context_t ctx, long min_nr, long max_nr, io_event* events, timespec* timeout);
-int io_cancel(aio_context_t ctx, iocb*, io_event* result);
-void io_prep(iocb* iocb, int fd, const void* buf, uint64_t count, int64_t offset, bool read);
+int io_submit(aio_context_t ctx, long nr, struct iocb** iocbpp);
+int io_getevents(aio_context_t ctx, long min_nr, long max_nr, struct io_event* events,
+ struct timespec* timeout);
+int io_cancel(aio_context_t ctx, struct iocb*, struct io_event* result);
+
+void io_prep_pread(struct iocb* iocb, int fd, void* buf, size_t count, long long offset);
+void io_prep_pwrite(struct iocb* iocb, int fd, void* buf, size_t count, long long offset);
+void io_prep(struct iocb* iocb, int fd, const void* buf, uint64_t count, int64_t offset, bool read);
#ifdef __cplusplus
};