Skip to content

Commit

Permalink
Remove e2e tests dependency on linux/aio_abi.h header
Browse files Browse the repository at this point in the history
  • Loading branch information
kmeisthax committed Nov 21, 2021
1 parent 399265e commit eafda59
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 2 deletions.
35 changes: 34 additions & 1 deletion tests/e2e/aio_rw/aio_rw.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <linux/aio_abi.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <stdio.h>
Expand All @@ -7,6 +6,40 @@
#include <errno.h>
#include <stdint.h>

typedef uint64_t aio_context_t;

enum {
IOCB_CMD_PREAD = 0,
IOCB_CMD_PWRITE = 1,
IOCB_CMD_FSYNC = 2,
IOCB_CMD_FDSYNC = 3,
IOCB_CMD_NOOP = 6,
IOCB_CMD_PREADV = 7,
IOCB_CMD_PWRITEV = 8,
};

struct iocb {
uint64_t aio_data;
uint32_t aio_key;
uint32_t aio_rw_flags;
uint16_t aio_lio_opcode;
int16_t aio_reqprio;
uint32_t aio_fildes;
uint64_t aio_buf;
uint64_t aio_nbytes;
int64_t aio_offset;
uint64_t aio_reserved2;
uint32_t aio_flags;
uint32_t aio_resfd;
};

struct io_event {
uint64_t data;
uint64_t obj;
int64_t res;
int64_t res2;
};

const char* info = "Welcome to ASYNC world!";

void main() {
Expand Down
35 changes: 34 additions & 1 deletion tests/e2e/aio_rw_vectored/aio_rw_vectored.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <linux/aio_abi.h>
#include <sys/syscall.h>
#include <sys/uio.h>
#include <fcntl.h>
Expand All @@ -8,6 +7,40 @@
#include <errno.h>
#include <stdint.h>

typedef uint64_t aio_context_t;

enum {
IOCB_CMD_PREAD = 0,
IOCB_CMD_PWRITE = 1,
IOCB_CMD_FSYNC = 2,
IOCB_CMD_FDSYNC = 3,
IOCB_CMD_NOOP = 6,
IOCB_CMD_PREADV = 7,
IOCB_CMD_PWRITEV = 8,
};

struct iocb {
uint64_t aio_data;
uint32_t aio_key;
uint32_t aio_rw_flags;
uint16_t aio_lio_opcode;
int16_t aio_reqprio;
uint32_t aio_fildes;
uint64_t aio_buf;
uint64_t aio_nbytes;
int64_t aio_offset;
uint64_t aio_reserved2;
uint32_t aio_flags;
uint32_t aio_resfd;
};

struct io_event {
uint64_t data;
uint64_t obj;
int64_t res;
int64_t res2;
};

const char* info0 = "Welcome to ASYNC world - ";
const char* info1 = "now you're writing with vectors";

Expand Down

0 comments on commit eafda59

Please sign in to comment.