Commit bbc38f3d authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Simple test for AIO ring

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 95945950
......@@ -20,6 +20,7 @@ static/cwd00
static/cwd01
static/cwd02
static/env00
static/aio00
static/maps00
static/maps01
static/maps02
......@@ -190,6 +191,7 @@ static/remap_dead_pid
TEST_CR_KERNEL="
ns/static/tun
static/timerfd
static/aio00
"
cat /proc/self/fdinfo/1 | grep -q mnt_id
......
......@@ -116,6 +116,7 @@ TST_NOFILE = \
dumpable01 \
dumpable02 \
remap_dead_pid \
aio00 \
fd \
# jobctl00 \
......@@ -272,6 +273,7 @@ wait_stop:
$(TST): $(LIB)
aio00: override LDFLAGS += -laio
futex.o: override CFLAGS += -pthread
futex: override LDFLAGS += -pthread
futex-rl.o: override CFLAGS += -pthread
......
#include <libaio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "zdtmtst.h"
const char *test_doc = "Check that plain io_setup works";
const char *test_author = "Pavel Emelianov <xemul@parallels.com>";
int main(int argc, char **argv)
{
int ret;
io_context_t ctx = 0;
test_init(argc, argv);
if (io_setup(1, &ctx) < 0) {
err("Can't setup io ctx");
return 1;
}
test_daemon();
test_waitsig();
ret = io_getevents(ctx, 0, 1, NULL, NULL);
if (ret != 0) {
if (ret < 0)
fail("IO ctx lost (%d)", ret);
else
fail("IO ctx screwed up (%d)", ret);
} else
pass();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment